home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / remin301.zip / REMIND.MAN < prev    next >
Text File  |  1993-01-16  |  102KB  |  2,509 lines

  1.  
  2.  
  3.  
  4. REMIND(1)                                               REMIND(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        remind - a sophisticated reminder service
  9.  
  10. SSYYNNOOPPSSIISS
  11.        rreemmiinndd [[_o_p_t_i_o_n_s] _f_i_l_e_n_a_m_e [_d_a_t_e]
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.        RReemmiinndd  reads  the supplied _f_i_l_e_n_a_m_e and executes the com-
  15.        mands found  in  it.   The  commands  are  used  to  issue
  16.        reminders  and alarms.  Each reminder or alarm can consist
  17.        of a message sent to standard output, or a program  to  be
  18.        executed.
  19.  
  20. OOPPTTIIOONNSS
  21.        --nn     The  --nn  option  causes  RReemmiinndd  to  print the nneexxtt
  22.               occurrence of each reminder in  a  simple  calendar
  23.               format.   You  can  sort this by date by piping the
  24.               output through ssoorrtt((11)).
  25.  
  26.        --rr     The --rr  option  disables  RRUUNN  directives  and  the
  27.               sshheellll(()) function
  28.  
  29.        --cc_n    The  --cc  option causes RReemmiinndd to produce a calendar
  30.               which is sent to standard output.  If you supply  a
  31.               number  _n,  then a calendar will be generated for _n
  32.               months,  starting  with  the  current  month.    By
  33.               default,  a  calendar for only the current month is
  34.               produced.  If _n starts with '+',  then  a  calendar
  35.               for _n weeks is produced.
  36.  
  37.        --ww_n    The  --ww  option  specifies  the output width of the
  38.               formatted calendar, in columns.   By  default,  the
  39.               calendar is formatted for an 80-column device.
  40.  
  41.        --ss_n    The  --ss  option  is  very similar to the --cc option,
  42.               except that the output calendar is  not  formatted.
  43.               It is listed in a "simple format" which can be used
  44.               as input for  more  sophisticated  calendar-drawing
  45.               programs.
  46.  
  47.        --pp_n    The  --pp  option  is  very similar to the --ss option,
  48.               except that the output contains additional informa-
  49.               tion for use by the rreemm22ppss program, which creates a
  50.               PostScript calendar.
  51.  
  52.        --vv     The --vv option makes the output of  RReemmiinndd  slightly
  53.               more verbose.
  54.  
  55.        --oo     The  --oo  option  causes  RReemmiinndd  to ignore all OONNCCEE
  56.               directives.
  57.  
  58.        --tt     The --tt option causes RReemmiinndd  to  trigger  all  non-
  59.               expired reminders, regardless of the _d_e_l_t_a supplied
  60.               for each reminder.
  61.  
  62.  
  63.  
  64.                          11 November 1992                       1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. REMIND(1)                                               REMIND(1)
  71.  
  72.  
  73.        --hh     The --hh option ("hush...") supresses certain warning
  74.               and  information  messages.   In  particular, if no
  75.               reminders are triggered, this mode produces no out-
  76.               put.
  77.  
  78.        --aa     The  --aa  option  causes  RReemmiinndd  not to immediately
  79.               trigger timed reminders which would also be queued.
  80.  
  81.        --qq     The  --qq  option  causes  RReemmiinndd  not to queue timed
  82.               reminders for later execution.
  83.  
  84.        --ff     The --ff option causes RReemmiinndd to remain in the  fore-
  85.               ground  when  processing  queued  reminders, rather
  86.               than forking off a  background  process  to  handle
  87.               them.
  88.  
  89.        --ee     The --ee option diverts error messages (normally sent
  90.               to the standard error stream) to the standard  out-
  91.               put stream.
  92.  
  93.        --dd_c_h_a_r_s
  94.               The --dd option enables certain debugging modes.  The
  95.               _c_h_a_r_s specify which modes to enable:
  96.  
  97.          ee      Echo all input lines
  98.  
  99.          xx      Trace all expression evaluation
  100.  
  101.          tt      Display all trigger date computation
  102.  
  103.          vv      Dump the variable table after  execution  of  the
  104.                 reminder script
  105.  
  106.          ll      Echo lines when displaying error messages
  107.  
  108.        --bb[_n]  Set  the  time  format for the calendar and simple-
  109.               calendar outputs.  _N can range from 0  to  2,  with
  110.               the  default  0.   A  value of 0 causes times to be
  111.               inserted in 12-hour (am/pm) format.  1 causes times
  112.               to  be  inserted  in 24-hour format, and 2 inhibits
  113.               the automatic insertion of times  in  the  calendar
  114.               output.
  115.  
  116.        --xx[_n]  Sets  the iteration limit for the SSAATTIISSFFYY clause of
  117.               a RREEMM command.  Defaults to 150.
  118.  
  119.        --zz[_n]  Runs RReemmiinndd in the daemon mode.  If _n is  supplied,
  120.               it  specifies  how often (in minutes) RReemmiinndd should
  121.               wake up to check if the reminder  script  has  been
  122.               changed.   _N defaults to 5, and can range from 5 to
  123.               60.  Note that  the  use  of  the  --zz  option  also
  124.               enables the --ff option.
  125.  
  126.        If  you supply a _d_a_t_e on the command line, it must consist
  127.  
  128.  
  129.  
  130.                          11 November 1992                       2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. REMIND(1)                                               REMIND(1)
  137.  
  138.  
  139.        of _d_a_y _m_o_n_t_h _y_e_a_r, where _d_a_y is  the  day  of  the  month,
  140.        _m_o_n_t_h  is  at least the first three letters of the English
  141.        name of the month, and _y_e_a_r is a year (all 4 digits)  from
  142.        1990 to about 2075.  You can leave out the _d_a_y, which then
  143.        defaults to 1.
  144.  
  145.        If you do supply a _d_a_t_e on the command line,  then  RReemmiinndd
  146.        uses it, rather than the actual system date, as its notion
  147.        of "today."  This lets you  create  calendars  for  future
  148.        months,  or  test  to see how your reminders will be trig-
  149.        gered in the future.
  150.  
  151. RREEMMIINNDDEERR FFIILLEESS
  152.        RReemmiinndd uses scripts to control its  operation.   The  com-
  153.        mands  inside  a script can range from the very simple and
  154.        almost immediately understandable:
  155.  
  156.             REM 6 Jan MSG David's birthday
  157.  
  158.        to the baroque and obscure:
  159.  
  160.             REM [trigger(date(thisyear, 1, 1) + 180)] ++5 OMIT \
  161.             sat sun SKIP MSG [ord(thisyear-1980)] payment due %b!
  162.  
  163.        A reminder file consists of commands, with one command per
  164.        line.   Several lines can be continued using the backslash
  165.        character, as in the above example.  In this case, all  of
  166.        the  concatenated  lines  are  treated as a single line by
  167.        RReemmiinndd.  Note that if an error occurs, RReemmiinndd reports  the
  168.        line number of the last line of a continued line.
  169.  
  170.        RReemmiinndd  ignores  blank lines, and lines beginning with the
  171.        '#' or ';' characters.  You can use  the  semicolon  as  a
  172.        comment  character  if  you  wish  to pass a RReemmiinndd script
  173.        through the C  pre-processor,  which  interprets  the  '#'
  174.        character as the start of a pre-processing directive.
  175.  
  176.        RReemmiinndd  is  not  case sensitive; you can generally use any
  177.        mixture of upper- or lower-case for commands,  parameters,
  178.        invocation options, etc.
  179.  
  180. TTHHEE RREEMM CCOOMMMMAANNDD
  181.        The  most  powerful  command in a RReemmiinndd script is the RREEMM
  182.        command.   This  command  is   responsible   for   issuing
  183.        reminders.  Its syntax is:
  184.  
  185.               RREEMM  [OONNCCEE]  [_d_a_t_e___s_p_e_c]  [_b_a_c_k]  [_d_e_l_t_a]  [_r_e_p_e_a_t]
  186.               [SSKKIIPP | BBEEFFOORREE | AAFFTTEERR] [OOMMIITT _o_m_i_t___l_i_s_t]  [AATT  _t_i_m_e
  187.               [_t_d_e_l_t_a] [_t_r_e_p_e_a_t]] [UUNNTTIILL _e_x_p_i_r_y___d_a_t_e] MMSSGG | RRUUNN |
  188.               CCAALL | SSAATTIISSFFYY _b_o_d_y
  189.  
  190.        The parts of the RREEMM  command  can  be  specified  in  any
  191.        order,  except  that  the _b_o_d_y must come immediately after
  192.        the MMSSGG, RRUUNN, CCAALL or SSAATTIISSFFYY keyword.
  193.  
  194.  
  195.  
  196.                          11 November 1992                       3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. REMIND(1)                                               REMIND(1)
  203.  
  204.  
  205.        The RREEMM token is optional, providing that the remainder of
  206.        the  command cannot be mistaken for another RReemmiinndd command
  207.        such as OOMMIITT or RRUUNN.   The  portion  of  the  RREEMM  command
  208.        before  the  MMSSGG,  RRUUNN,  CCAALL or SSAATTIISSFFYY clause is called a
  209.        _t_r_i_g_g_e_r.
  210.  
  211.        MMSSGG,, RRUUNN,, aanndd CCAALL
  212.  
  213.        The keywords MMSSGG, RRUUNN and  CCAALL  denote  the  _t_y_p_e  of  the
  214.        reminder.   (SSAATTIISSFFYY  is  more  complicated  and  will  be
  215.        explained later.)  A MMSSGG type  reminder  simply  prints  a
  216.        message  to  the  standard  output, after passing the _b_o_d_y
  217.        through a special substitution filter,  described  in  the
  218.        section  "The  Substitution  Filter."  A RRUUNN-type reminder
  219.        also passes the _b_o_d_y through the substitution filter,  but
  220.        then  executes the result as a system command.  A CCAALL-type
  221.        reminder is used only to place  entries  in  the  calendar
  222.        produced when RReemmiinndd is run with the -c or -s options.
  223.  
  224.        DDAATTEE SSPPEECCIIFFIICCAATTIIOONNSS
  225.  
  226.        A  _d_a_t_e___s_p_e_c  consists of zero to four parts.  These parts
  227.        are _d_a_y (day of month), _m_o_n_t_h (month name), _y_e_a_r and _w_e_e_k_-
  228.        _d_a_y_.   _M_o_n_t_h  and  _w_e_e_k_d_a_y are the English names of months
  229.        and weekdays.  At least the first three characters must be
  230.        used.   The following are examples of the various parts of
  231.        a _d_a_t_e___s_p_e_c_:
  232.  
  233.        _d_a_y_:   1, 22, 31, 14, 3
  234.  
  235.        _m_o_n_t_h_: JANUARY, feb, March, ApR, may, Aug
  236.  
  237.        _y_e_a_r_:  1990, 1993, 2030, 95 (interpreted  as  1995).   The
  238.               year can range from 1990 to 2075.
  239.  
  240.        _w_e_e_k_d_a_y_:
  241.               Monday, tue, Wed, THU, Friday, saturday, sundAy
  242.  
  243.        Note  that  there  can be several _w_e_e_k_d_a_y components sepa-
  244.        rated by spaces in a _d_a_t_e___s_p_e_c_.
  245.  
  246.        IINNTTEERRPPRREETTAATTIIOONN OOFF DDAATTEE SSPPEECCIIFFIICCAATTIIOONNSS
  247.  
  248.        The following examples show how  date  specifications  are
  249.        interpreted.
  250.  
  251.        1.  Null  date  specification  - the reminder is triggered
  252.        every day.  The trigger date for a specific run is  simply
  253.        the current system date.
  254.  
  255.        2.  Only  _d_a_y  present.   The reminder is triggered on the
  256.        specified day of each month.  The trigger date for a  par-
  257.        ticular  run is the closest such day to the current system
  258.        date.  For example:
  259.  
  260.  
  261.  
  262.                          11 November 1992                       4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. REMIND(1)                                               REMIND(1)
  269.  
  270.  
  271.             REM 1 MSG First of every month.
  272.             REM 31 MSG 31st of every month that has 31 days.
  273.  
  274.        3. Only _m_o_n_t_h present.  The reminder  is  triggered  every
  275.        day of the specified month.  Example:
  276.             REM Feb MSG Every day in February
  277.  
  278.        4.  _d_a_y and _m_o_n_t_h present.  Examples:
  279.             REM 6 Jan MSG Every 6th of January
  280.             REM Feb 29 MSG Every 29th of February
  281.  
  282.        5.  Only _y_e_a_r present. Example:
  283.             REM 1991 MSG Every day in 1991
  284.  
  285.        6.  _y_e_a_r and _d_a_y present.  Examples:
  286.             REM 1 1990 MSG 1st of every month in 1990
  287.             REM 1992 23 MSG 23rd of every month in 1992
  288.  
  289.        7.  _y_e_a_r and _m_o_n_t_h present.  Examples:
  290.             REM Feb 1991 MSG Every day in Feb 1991
  291.             REM 1992 September MSG Every day in Sept 1992
  292.  
  293.        8.  _y_e_a_r_, _m_o_n_t_h and _d_a_y present.  Examples:
  294.             REM 8 Jan 1991 MSG 8th January 1991.
  295.             REM 1992 March 9 MSG 9th March 1992.
  296.  
  297.        9.  _w_e_e_k_d_a_y only.  Examples:
  298.             REM Sat MSG Every Saturday
  299.             REM Mon Tue Wed Thu Fri MSG Every working day
  300.             REM Monday Wednesday MSG Every Monday and Wednesday
  301.  
  302.        10.  _w_e_e_k_d_a_y and _d_a_y present.  Examples:
  303.             REM Sat 1 MSG First Saturday of every month
  304.             REM Mon Tue Wed Thu Fri 15 \
  305.                  MSG 1st working day after 15th of every month
  306.  
  307.        11.  _w_e_e_k_d_a_y and _m_o_n_t_h present.  Examples:
  308.             REM Mon March MSG Every Monday in March
  309.             REM Mon Tue Wed Thu Fri Feb MSG Every working day in February
  310.  
  311.        12.  _w_e_e_k_d_a_y_, _m_o_n_t_h and _d_a_y present.  Examples:
  312.             REM Mon 1 March MSG First Monday in March
  313.             REM Sat Sun 15 July MSG First Sat or Sun on or after 15 July
  314.  
  315.        13.  _w_e_e_k_d_a_y and _y_e_a_r present.  Example:
  316.             REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
  317.  
  318.        14.  _w_e_e_k_d_a_y_, _d_a_y and _y_e_a_r present.  Examples:
  319.             REM Mon 15 1990 MSG 1st Mon after 15th of every month in 1990
  320.             REM Mon Tue Wed Thu Fri 1 1990 \
  321.                  MSG 1st working day of every month in 1990
  322.  
  323.        15.  _w_e_e_k_d_a_y_, _m_o_n_t_h and _y_e_a_r present.  Example:
  324.             REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
  325.  
  326.  
  327.  
  328.                          11 November 1992                       5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. REMIND(1)                                               REMIND(1)
  335.  
  336.  
  337.        16.  _w_e_e_k_d_a_y_, _d_a_y_, _m_o_n_t_h and _y_e_a_r present.  Example:
  338.             REM Mon Tue Wed Thu Fri 28 Oct 1990 \
  339.                  MSG 1st working day on or after 28 October 1990.
  340.  
  341.        Note  that when both _w_e_e_k_d_a_y and _d_a_y are specified, RReemmiinndd
  342.        chooses the first date on or after the specified _d_a_y which
  343.        also  satisfies  the  _w_e_e_k_d_a_y constraint.  It does this by
  344.        picking the first date on or after the specified _d_a_y which
  345.        is listed in the list of _w_e_e_k_d_a_y_s_.  Thus, a reminder like:
  346.  
  347.             REM Mon Tue 28 Oct 1990 MSG Hi
  348.  
  349.        would be issued only on  Monday,  29  October,  1990.   It
  350.        would  not  be  issued on Tuesday, 30 October, 1990, since
  351.        the 29th is the first date to  satisfy  the  _w_e_e_k_d_a_y  con-
  352.        straints.
  353.  
  354.        BBAACCKKWWAARRDD SSCCAANNNNIINNGG
  355.  
  356.        Sometimes,  it  is  necessary to specify a date as being a
  357.        set amount of time before another date.  For example,  the
  358.        last Monday in a given month is computed as the first Mon-
  359.        day in the next month, minus 7 days.  The _b_a_c_k  specifica-
  360.        tion in the reminder is used in this case:
  361.  
  362.             REM Mon 1 -7 MSG Last Monday of every month.
  363.  
  364.        A  _b_a_c_k is specified with one or two dashes followed by an
  365.        integer.  This causes RReemmiinndd to move "backwards" from what
  366.        would  normally  be  the  trigger  date.   The  difference
  367.        between --7 and -7 will be explained when the OOMMIITT keyword
  368.        is described.
  369.  
  370.        AADDVVAANNCCEE WWAARRNNIINNGG
  371.  
  372.        For  some  reminders, it is appropriate to receive advance
  373.        warning of the event.  For example, you  may  wish  to  be
  374.        reminded  of  someone's  birthday several days in advance.
  375.        The _d_e_l_t_a portion of the RREEMM command achieves this.  It is
  376.        specified  as one or two "+" signs followed by a number _n.
  377.        Again, the difference between the "+" and "++" forms  will
  378.        be  explained under the OOMMIITT keyword.  RReemmiinndd will trigger
  379.        the reminder on computed trigger date, as well as on  each
  380.        of the _n days before the event.  Here are some examples:
  381.  
  382.             REM 6 Jan +5 MSG Remind me of birthday 5 days in advance.
  383.  
  384.        The above example would be triggered every 6th of January,
  385.        as well as the 1st through 5th of January.
  386.  
  387.        PPEERRIIOODDIICC RREEMMIINNDDEERRSS
  388.  
  389.        We have already seen some built-in mechanisms for  certain
  390.        types  of  periodic  reminders.   For  example,  an  event
  391.  
  392.  
  393.  
  394.                          11 November 1992                       6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. REMIND(1)                                               REMIND(1)
  401.  
  402.  
  403.        occurring every Wednesday could be specified as:
  404.  
  405.             REM Wed MSG Event!
  406.  
  407.        However, events which do not repeat daily, weekly, monthly
  408.        or  yearly require another approach.  The _r_e_p_e_a_t component
  409.        of the RREEMM command fills this need.  To use it,  you  must
  410.        completely  specify  a  date  (year,  month  and  day, and
  411.        optionally weekday.)  The _r_e_p_e_a_t component is an  asterisk
  412.        followed  by  a number specifying the repetition period in
  413.        days.
  414.  
  415.        For example, suppose you get paid every second  Wednesday,
  416.        and your last payday was Wednesday, 28 October, 1992.  You
  417.        can use:
  418.  
  419.             REM 28 Oct 1992 *14 MSG Payday
  420.  
  421.        This issues the reminder every 14 days, starting from  the
  422.        calculated  trigger date.  You can use _d_e_l_t_a and _b_a_c_k with
  423.        _r_e_p_e_a_t_.  Note, however, that the _b_a_c_k is used only to com-
  424.        pute  the  initial  trigger date; thereafter, the reminder
  425.        repeats with the  specified  period.   Similarly,  if  you
  426.        specify  a  weekday, it is used only to calculate the ini-
  427.        tial date, and does not affect the repetition period.
  428.  
  429.        EEXXPPIIRRYY DDAATTEESS
  430.  
  431.        Some reminders should be issued periodically for a certain
  432.        time,  but  then  expire.  For example, suppose you have a
  433.        class every Friday, and that your  last  class  is  on  11
  434.        December 1992.  You can use:
  435.  
  436.             REM Fri UNTIL 11 Dec 1992 MSG Class today.
  437.  
  438.        Another  example:   Suppose  you  have  jury  duty from 30
  439.        November  1992  until  4  December  1992.   The  following
  440.        reminder  will  issue  the  message every day of your jury
  441.        duty, as well as 2 days ahead of time:
  442.  
  443.             REM 30 Nov 1992 *1 +2 UNTIL 4 Dec 1992 MSG Jury duty
  444.  
  445.        Note that the _r_e_p_e_a_t of *1 is necessary; without  it,  the
  446.        reminder  would be issued only on 30 November (and the two
  447.        days preceding.)
  448.  
  449.        TTHHEE OONNCCEE KKEEYYWWOORRDD
  450.  
  451.        Sometimes, it is necessary to ensure  that  reminders  are
  452.        run  only once on a given day.  For example, if you have a
  453.        reminder which makes a backup of your files every Friday:
  454.  
  455.             REM Fri RUN do_backup
  456.  
  457.  
  458.  
  459.  
  460.                          11 November 1992                       7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. REMIND(1)                                               REMIND(1)
  467.  
  468.  
  469.        (Here, _d_o___b_a_c_k_u_p is assumed  to  be  a  program  or  shell
  470.        script  which does the work.)  If you run RReemmiinndd from your
  471.        .login script, for example, and log in several  times  per
  472.        day,  the  _d_o___b_a_c_k_u_p program will be run each time you log
  473.        in.   If,  however,  you  use  the  OONNCCEE  keyword  in  the
  474.        reminder,  the  RReemmiinndd  checks the last access date of the
  475.        reminder script.  If it is the same as the  current  date,
  476.        RReemmiinndd  assumes that it has already been run, and will not
  477.        issue reminders containing the OONNCCEE keyword.
  478.  
  479.        Note that if you view or edit your  reminder  script,  the
  480.        last  access  date  will  be updated, and the OONNCCEE keyword
  481.        will not operate properly.  If you start RReemmiinndd  with  the
  482.        --oo option, then the OONNCCEE keyword will be ignored.
  483.  
  484.        LLOOCCAALLLLYY OOMMIITTTTIINNGG WWEEEEKKDDAAYYSS
  485.  
  486.        The OOMMIITT portion of the RREEMM command is used to "omit" cer-
  487.        tain days when counting the _d_e_l_t_a or _b_a_c_k.  It  is  speci-
  488.        fied  using  the  keyword OOMMIITT followed by a list of week-
  489.        days.  Its action is best illustrated with examples:
  490.  
  491.             REM 1 +1 OMIT Sat Sun MSG Important Event
  492.  
  493.        This reminder is normally triggered on the first of  every
  494.        month,  as  well as the day preceding it.  However, if the
  495.        first of the month falls on a Sunday or Monday,  then  the
  496.        reminder  is  triggered starting from the previous Friday.
  497.        This is because the _d_e_l_t_a of +1 does not count Saturday or
  498.        Sunday  when  it counts backwards from the trigger date to
  499.        determine how much advance warning to give.
  500.  
  501.        Contrast this with the use of "++1" in the above  command.
  502.        In  this  case,  the reminder is triggered on the first of
  503.        each month, as well as the day preceding it.  The  omitted
  504.        days are counted.
  505.  
  506.             REM 1 -1 OMIT Sat Sun MSG Last working day of month
  507.  
  508.        Again,  in  the  above  example,  the  _b_a_c_k of -1 normally
  509.        causes the trigger date to be the last day of  the  month.
  510.        However,  because  of the OOMMIITT clause, if the first of the
  511.        month falls on a Sunday or Monday,  the  trigger  date  is
  512.        moved  backwards past the weekend to Friday.  (If you have
  513.        globally omitted holidays, the reminder will be moved back
  514.        past   them,  also.   See  "The  OMIT  command"  for  more
  515.        details.)
  516.  
  517.        By comparison, if we had used "--1", the reminder would be
  518.        triggered  on the last day of the month, regardless of the
  519.        OOMMIITT.
  520.  
  521.        TTIIMMEEDD RREEMMIINNDDEERRSS
  522.  
  523.  
  524.  
  525.  
  526.                          11 November 1992                       8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. REMIND(1)                                               REMIND(1)
  533.  
  534.  
  535.        Timed reminders are those which have an  AATT  keyword  fol-
  536.        lowed by a _t_i_m_e and optional _t_d_e_l_t_a and _t_r_e_p_e_a_t.  The _t_i_m_e
  537.        must be specified in 24-hour format, with 0:00  represent-
  538.        ing  midnight,  12:00  representing noon, and 23:59 repre-
  539.        senting one minute to midnight.
  540.  
  541.        RReemmiinndd treats timed reminders specially.  If  the  trigger
  542.        date  for a timed reminder is the same as the current sys-
  543.        tem date, the reminder is  queued  for  later  activation.
  544.        When  RReemmiinndd has finished processing the reminder file, it
  545.        puts  itself  in  the  background,  and  activates   timed
  546.        reminders when the system time reached the specified time.
  547.  
  548.        If the trigger date is _n_o_t the same as  the  system  date,
  549.        the reminder is not queued.
  550.  
  551.        For example, the following reminder, triggered every work-
  552.        ing day, will emit a  message  telling  you  to  leave  at
  553.        5:00pm:
  554.  
  555.             REM Mon Tue Wed Thu Fri AT 17:00 MSG Time to leave!
  556.  
  557.        The  following reminder will be triggered on Thursdays and
  558.        Fridays, but will only be queued on Fridays:
  559.  
  560.             REM Fri ++1 AT 13:00 MSG Lunch at 1pm Friday.
  561.  
  562.        The _t_d_e_l_t_a and _t_r_e_p_e_a_t have the same form as a _r_e_p_e_a_t  and
  563.        _d_e_l_t_a,  but  are  specified in minutes.  For example, this
  564.        reminder will be triggered at 12:00pm as well as  45  min-
  565.        utes before:
  566.  
  567.             REM AT 12:00 +45 MSG Example
  568.  
  569.        The following will be issued starting at 10:45, every half
  570.        hour until 11:45, and again at noon.
  571.  
  572.             REM AT 12:00 +75 *30 MSG Example2
  573.  
  574.        The "+75" means that the reminder is  issued  starting  75
  575.        minutes  before  noon;  in other words, at 10:45.  The *30
  576.        specifies that the reminder is subsequently to  be  issued
  577.        every 30 minutes.  Note that the reminder is always issued
  578.        at the specified time, even if the _t_d_e_l_t_a is not a  multi-
  579.        ple  of  the  _t_r_e_p_e_a_t.   So the above example is issued at
  580.        10:45am, 11:15am, 11:45am, and 12:00pm.  Note that in  the
  581.        time  specification,  there  is no distinction between the
  582.        "+" and "++" forms of _t_d_e_l_t_a.
  583.  
  584.        Normally, RReemmiinndd will issue timed  reminders  as  it  pro-
  585.        cesses  the  reminder  script, as well as queuing them for
  586.        later.  If you do not want RReemmiinndd to issue  the  reminders
  587.        when  processing  the  script,  but only to queue them for
  588.        later, use the --aa command-line option.  If you do not want
  589.  
  590.  
  591.  
  592.                          11 November 1992                       9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. REMIND(1)                                               REMIND(1)
  599.  
  600.  
  601.        reminders  to be queued for later, use the --qq command-line
  602.        option.
  603.  
  604.        Normally, RReemmiinndd forks  a  background  process  to  handle
  605.        queued  reminders.   If  you  want RReemmiinndd to remain in the
  606.        foreground, use the --ff command-line option.  This is  use-
  607.        ful,  for  example, in .xinitrc scripts, where you can use
  608.        the command:
  609.  
  610.             remind -fa myreminders &
  611.  
  612.        This ensures that when you exit X-Windows, the RReemmiinndd pro-
  613.        cess is killed.
  614.  
  615.        WWAARRNNIINNGG AABBOOUUTT TTIIMMEEDD RREEMMIINNDDEERRSS
  616.  
  617.        Note:   If  you  use  user-defined  functions or variables
  618.        (described later) in the bodies of timed  reminders,  then
  619.        when  the timed reminders are activated, the variables and
  620.        functions have the definitions which were in effect at the
  621.        end  of  the  reminder  script.  These definitions may _n_o_t
  622.        necessarily be those which were in effect at the time  the
  623.        reminder was queued.
  624.  
  625.  
  626. TTHHEE SSUUBBSSTTIITTUUTTIIOONN FFIILLTTEERR
  627.        Before  being  processed,  the  body  of  a RREEMM command is
  628.        passed through a substitution filter.   The  filter  scans
  629.        for  sequences  "%x"  (where "x" is any letter and certain
  630.        other characters)  and  performs  substitutions  as  shown
  631.        below.   (All  dates  refer  to  the  trigger  date of the
  632.        reminder.)
  633.  
  634.        %%aa     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y _m_o_n_t_h_, _y_e_a_r"
  635.               For example, consider the reminder:
  636.  
  637.               REM 18 Oct 1990 +4 MSG Meeting with Bob %a.
  638.  
  639.               On 16 October 1990, it would  print  "Meeting  with
  640.               Bob on Thursday, 18 October, 1990."
  641.  
  642.               On  17  October  1990, it would print "Meeting with
  643.               Bob tomorrow."
  644.  
  645.               On 18 October 1990, it would  print  "Meeting  with
  646.               Bob today."
  647.  
  648.        %%bb     is replaced with "in _d_i_f_f day's time" where _d_i_f_f is
  649.               the aaccttuuaall number of days between the current  date
  650.               and the trigger date.  (OOMMIITTss have no effect.)
  651.               For example, consider:
  652.  
  653.               REM 18 Oct 1990 +4 MSG Meeting with Bob %b.
  654.  
  655.  
  656.  
  657.  
  658.                          11 November 1992                      10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. REMIND(1)                                               REMIND(1)
  665.  
  666.  
  667.               On  16  October  1990, it would print "Meeting with
  668.               Bob in 2 days' time."
  669.  
  670.               On 17 October 1990, it would  print  "Meeting  with
  671.               Bob tomorrow."
  672.  
  673.               On  18  October  1990, it would print "Meeting with
  674.               Bob today."
  675.  
  676.        %%cc     is replaced with "on _w_e_e_k_d_a_y"
  677.               Example: REM 18 Oct 1990 +4 MSG  Meeting  with  Bob
  678.               %c.
  679.  
  680.               On  16  October  1990, it would print "Meeting with
  681.               Bob on Thursday."
  682.  
  683.               On 17 October 1990, it would  print  "Meeting  with
  684.               Bob tomorrow."
  685.  
  686.               On  18  October  1990, it would print "Meeting with
  687.               Bob today."
  688.  
  689.        %%dd     is replaced with "_d_a_y", the day of the month.
  690.  
  691.        %%ee     is replaced with "on _d_d_/_m_m_/_y_y_y_y"
  692.  
  693.        %%ff     is replaced with "on _m_m_/_d_d_/_y_y_y_y"
  694.  
  695.        %%gg     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y _m_o_n_t_h"
  696.  
  697.        %%hh     is replaced with "on _d_d_/_m_m"
  698.  
  699.        %%ii     is replaced with "on _m_m_/_d_d"
  700.  
  701.        %%jj     is replaced with "on _w_e_e_k_d_a_y_, _m_o_n_t_h  _d_a_y_-_t_h_,  _y_e_a_r"
  702.               This  form  appends the characters "st", "nd", "rd"
  703.               or "th" to the day of the month, as appropriate.
  704.  
  705.        %%kk     is replaced with "on _w_e_e_k_d_a_y_, _m_o_n_t_h _d_a_y_-_t_h"
  706.  
  707.        %%ll     is replaced with "on _y_y_y_y_/_m_m_/_d_d"
  708.  
  709.        %%mm     is replaced with "_m_o_n_t_h", the name of the month.
  710.  
  711.        %%nn     is replaced with the number (1 to 12) of the month.
  712.  
  713.        %%oo     is replaced with " (today)" if and only if the cur-
  714.               rent system date is the same as the date being used
  715.               by RReemmiinndd as the current date.  Recall that you can
  716.               specify a date for RReemmiinndd to  use  on  the  command
  717.               line.  This substitution is not generally useful in
  718.               a RREEMM command, but is useful in a  BBAANNNNEERR  command.
  719.               (See "The BANNER Command.")
  720.  
  721.  
  722.  
  723.  
  724.                          11 November 1992                      11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. REMIND(1)                                               REMIND(1)
  731.  
  732.  
  733.        %%pp     is  replaced  with "s" if the _d_i_f_f between the cur-
  734.               rent date and the trigger date is not 1.   You  can
  735.               use this to construct reminders like:
  736.               REM 1 Jan +4 MSG %x day%p to go before New Year!
  737.  
  738.        %%qq     is replaced with "'s" if the _d_i_f_f between the trig-
  739.               ger date and the current date is 1.  Otherwise,  it
  740.               is replaced with "s'"  This can be used as follows:
  741.               REM 1 Jan +4 MSG New Year in %x day%q time!
  742.  
  743.        %%rr     is replaced with the day of the month  (01  to  31)
  744.               padded  with a leading zero if needed to pad to two
  745.               digits.
  746.  
  747.        %%ss     is replaced with "st", "nd", "rd" or "th" depending
  748.               on the day of the month.
  749.  
  750.        %%tt     is replaced with the number of the month (01 to 12)
  751.               padded to two digits with a leading zero.
  752.  
  753.        %%uu     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y_-_t_h  _m_o_n_t_h_,  _y_e_a_r"
  754.               This  is similar to %%aa except that "st", "nd", "rd"
  755.               or "th" is added to the _d_a_y as appropriate.
  756.  
  757.        %%vv     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y_-_t_h _m_o_n_t_h"
  758.  
  759.        %%ww     is replaced with "_w_e_e_k_d_a_y", the name of the day  of
  760.               the week.
  761.  
  762.        %%xx     is  replaced with the _d_i_f_f between the current date
  763.               and the trigger date.  The _d_i_f_f is defined  as  the
  764.               actual  number  of  days  between  these two dates;
  765.               OOMMIITTss are not counted.  (Strict date subtraction is
  766.               performed.)
  767.  
  768.        %%yy     is  replaced  with  "_y_e_a_r", the year of the trigger
  769.               date.
  770.  
  771.        %%zz     is replaced with "_y_y", the last two digits  of  the
  772.               year.
  773.  
  774.        %%__     (percent-underscore)  is  replaced  with a newline.
  775.               You can use this to achieve multi-line reminders.
  776.  
  777.        %%11     is replaced with "now", "_m minutes  from  now",  "_m
  778.               minutes ago", "_h hours from now", "_h hours ago", "_h
  779.               hours and _m minutes from now" or  "_h  hours  and  _m
  780.               minutes  ago", as appropriate for a timed reminder.
  781.               Note that unless you specify the --aa  option,  timed
  782.               reminders  will be triggered like normal reminders,
  783.               and thus a timed reminder which occurred earlier in
  784.               the day may be triggered.  This causes the need for
  785.               the "...ago" forms.
  786.  
  787.  
  788.  
  789.  
  790.                          11 November 1992                      12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. REMIND(1)                                               REMIND(1)
  797.  
  798.  
  799.        %%22     is replaced with "at _h_h:_m_mam" or  "..pm"  depending
  800.               on the AATT time of the reminder.
  801.  
  802.        %%33     is replaced with "at _h_h:_m_m" in 24-hour format.
  803.  
  804.        %%44     is  replaced  with  "_m_m"  where _m_m is the number of
  805.               minutes between "now" and the time specified by AATT.
  806.               If  the  AATT  time is earlier than the current time,
  807.               then the result is negative.
  808.  
  809.        %%55     is replaced with "_m_a"  where  _m_a  is  the  absolute
  810.               value of the number produced by %%44.
  811.  
  812.        %%66     is  replaced with "ago" or "from now", depending on
  813.               the relationship between the AATT time and  the  cur-
  814.               rent time.
  815.  
  816.        %%77     is replaced with the number of hours between the AATT
  817.               time and the  current  time.   It  is  always  non-
  818.               negative.
  819.  
  820.        %%88     is  replaced with the number of minutes between the
  821.               AATT time and the current time, after the hours  (%%77)
  822.               have been subtracted out.  This is a number ranging
  823.               from 0 to 59.
  824.  
  825.        %%99     is replaced with "s" if the value produced by %%88 is
  826.               not 1.
  827.  
  828.        %%00     is replaced with "s" if the value produced by %%77 is
  829.               not 1.
  830.  
  831.        %%!!     is replaced with "is" if the current time is before
  832.               the AATT time, or "was" if it is after.
  833.  
  834.        %%@@     is similar to %%22 but displays the current time.
  835.  
  836.        %%##     is similar to %%33 but displays the current time.
  837.  
  838.        %%""     (percent-doublequote) is removed.  This sequence is
  839.               not used by the substitution filter, but is used to
  840.               tell  rreemmiinndd  which  text  to include in a calendar
  841.               entry when the --cc option is chosen.  See  "Calendar
  842.               Mode"
  843.  
  844.        Notes:
  845.  
  846.        o      RReemmiinndd  normally  prints  a  blank  line after each
  847.               reminder; if the last character of the body is "%",
  848.               the blank line will not be printed.
  849.  
  850.        o      Substitutions  a,  b,  c, e, f, g, h, i, j, k, l, u
  851.               and v all are replaced with "today" if the  current
  852.               date  equals the trigger date, or "tomorrow" if the
  853.  
  854.  
  855.  
  856.                          11 November 1992                      13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. REMIND(1)                                               REMIND(1)
  863.  
  864.  
  865.               trigger date is one day  after  the  current  date.
  866.               Thus,  they are nnoott the same as substitutions built
  867.               up from the simpler %w, %y, etc.  sequences.
  868.  
  869.        o      Any of  the  substitutions  dealing  with  time  (0
  870.               through  9  and  '!')  produce undefined results if
  871.               used in a reminder which does not have an  AATT  key-
  872.               word.   Also,  if a reminder has a _d_e_l_t_a and may be
  873.               triggered on several days, the  time  substitutions
  874.               ignore  the  date.   Thus,  the %%11 substitution may
  875.               report that a meeting is in 15 minutes,  for  exam-
  876.               ple,  even  though  it  may only be in 2 days time,
  877.               because a _d_e_l_t_a has triggered the reminder.  It  is
  878.               recommended  that  you  use  the time substitutions
  879.               only in timed reminders with  no  _d_e_l_t_a  which  are
  880.               designed to be queued for timed activation.
  881.  
  882.        o      Capital  letters  can  be  used in the substitution
  883.               sequence, in which case the first character of  the
  884.               substituted  string  is  capitalized (if it is nor-
  885.               mally a lower-case letter.)
  886.  
  887.        o      All other characters following a "%" sign are  sim-
  888.               ply  copied.  In particular, to get a "%" sign out,
  889.               use "%%" in the body.   To  start  the  body  of  a
  890.               reminder  with a space, use "% ", since rreemmiinndd nor-
  891.               mally scans for the first non-space character after
  892.               a MMSSGG,, CCAALL or RRUUNN token.
  893.  
  894. TTHHEE OOMMIITT CCOOMMMMAANNDD
  895.        In addition to being a keyword in the RREEMM command, OOMMIITT is
  896.        a command in its own right.  Its syntax is:
  897.  
  898.               OOMMIITT _d_a_y _m_o_n_t_h [_y_e_a_r]
  899.  
  900.        The OOMMIITT command is used to "globally" omit certain  days,
  901.        which  are  usually holidays.  These globally-omitted days
  902.        are skipped by the "-" and "+" forms of  _b_a_c_k  and  _d_e_l_t_a.
  903.        Some examples:
  904.  
  905.             OMIT 1 Jan
  906.             OMIT 7 Sep 1992
  907.  
  908.        The  first example specifies a holiday which occurs on the
  909.        same date each year - New Year's Day.  The second  example
  910.        specifies  a holiday which changes each year - Labour Day.
  911.        For these types of holidays, you must create an OOMMIITT  com-
  912.        mand for each year.  (Later, in the description of expres-
  913.        sions and some of the more advanced  features  of  RReemmiinndd,
  914.        you will see how to automate this for some cases.)
  915.  
  916.        For  convenience,  you can use a _d_e_l_t_a and MMSSGG or RRUUNN key-
  917.        word in the OOMMIITT command.   The  following  sequences  are
  918.        exactly equivalent:
  919.  
  920.  
  921.  
  922.                          11 November 1992                      14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. REMIND(1)                                               REMIND(1)
  929.  
  930.  
  931.             OMIT 1 Jan
  932.             REM 1 Jan +4 MSG New year's day is %b!
  933.  
  934.             and
  935.  
  936.             OMIT 1 Jan +4 MSG New year's day is %b!
  937.  
  938.        TTHHEE BBEEFFOORREE,, AAFFTTEERR AANNDD SSKKIIPP KKEEYYWWOORRDDSS
  939.  
  940.        Normally, days which are omitted, whether by a global OOMMIITT
  941.        command or the local OOMMIITT keyword in a RREEMM statement, only
  942.        affect the counting of the -_b_a_c_k or the +_d_e_l_t_a.  For exam-
  943.        ple, suppose you have a meeting every Wednesday.  Suppose,
  944.        too, that you have indicated 11 Nov as a holiday:
  945.  
  946.             OMIT 11 Nov +4 MSG Remembrance Day
  947.             REM Wed +1 MSG Code meeting %b.
  948.  
  949.        The  above  sequence will issue a reminder about a meeting
  950.        for 11 November 1992, which is a Wednesday.  This is prob-
  951.        ably incorrect.  There are three options:
  952.  
  953.        BBEEFFOORREE This keyword moves the reminder to before any omit-
  954.               ted days.  Thus,  in  the  above  example,  use  of
  955.               BBEEFFOORREE would cause the meeting reminder to be trig-
  956.               gered on Tuesday, 10 November 1992.
  957.  
  958.        AAFFTTEERR  This keyword moves the reminder to after any  omit-
  959.               ted  days.   In  the  above  example,  the  meeting
  960.               reminder would be triggered on Thursday, 12  Novem-
  961.               ber 1992.
  962.  
  963.        SSKKIIPP   This keyword causes the reminder to be skipped com-
  964.               pletely on any omitted days.  Thus,  in  the  above
  965.               example,  the reminder would not be triggered on 11
  966.               November 1992.  However, it would be  triggered  as
  967.               usual on the following Wednesday, 18 November 1992.
  968.  
  969.        The BBEEFFOORREE and AAFFTTEERR keywords move the trigger date  of  a
  970.        reminder  to  before  or  after  a  block of omitted days,
  971.        respectively.  Suppose you normally run a  backup  on  the
  972.        first  day of the month.  However, if the first day of the
  973.        month is a weekend or holiday, you run the backup  on  the
  974.        first  working  day following the weekend or holiday.  You
  975.        could use:
  976.  
  977.             REM 1 OMIT Sat Sun AFTER RUN do_backup
  978.  
  979.        Let's examine how the trigger date  is  computed.   The  11
  980.        specifies the first day of the month.  The local OOMMIITT key-
  981.        word causes the AAFFTTEERR keyword to move the reminder forward
  982.        past  weekends.  Finally, the AAFFTTEERR keyword will keep mov-
  983.        ing the reminder forward until it has passed any  holidays
  984.        specified with global OOMMIITT commands.
  985.  
  986.  
  987.  
  988.                          11 November 1992                      15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. REMIND(1)                                               REMIND(1)
  995.  
  996.  
  997. TTHHEE IINNCCLLUUDDEE CCOOMMMMAANNDD
  998.        RReemmiinndd  allows you to include other files in your reminder
  999.        script, similar to the C preprocessor #include  directive.
  1000.        For example, your system administrator may maintain a file
  1001.        of holidays or system-wide  reminders.   You  can  include
  1002.        these in your reminder script as follows:
  1003.  
  1004.             INCLUDE /usr/share/remind/holidays
  1005.             INCLUDE /usr/share/remind/reminders
  1006.  
  1007.        (The  actual  pathnames  vary  from system to system - ask
  1008.        your system administrator.)
  1009.  
  1010.        IINNCCLLUUDDEE files can be nested up to a depth of 8.
  1011.  
  1012.  
  1013. TTHHEE RRUUNN CCOOMMMMAANNDD
  1014.        If you include other files in your  reminder  script,  you
  1015.        may  not always entirely "trust" the contents of the other
  1016.        files.  For example, they may contain  RRUUNN-type  reminders
  1017.        which  could be used to access your files or perform unde-
  1018.        sired actions.  The RRUUNN command can restrict this:  If you
  1019.        include  the  command  RRUUNN  OOFFFF in your top-level reminder
  1020.        script, any reminder or expression  which  would  normally
  1021.        execute  a  system  command  is disabled.  RRUUNN OONN will re-
  1022.        enable the execution of system commands.   Note  that  the
  1023.        RRUUNN  command  can  _o_n_l_y be used in your top-level reminder
  1024.        script; it will _n_o_t work in  any  files  accessed  by  the
  1025.        IINNCCLLUUDDEE  command.   This  is  to  protect you from someone
  1026.        placing a RRUUNN OONN command in an included file.
  1027.  
  1028.        If you run RReemmiinndd with the --rr  command-line  option,  RRUUNN-
  1029.        type  reminders and the sshheellll(()) function will be disabled,
  1030.        regardless of any RRUUNN commands in the reminder script.
  1031.  
  1032.        One use of the RRUUNN command is to provide a  secure  inter-
  1033.        face between RReemmiinndd and the EEllmm mail system.  The EEllmm sys-
  1034.        tem can automatically scan incoming mail for  reminder  or
  1035.        calendar  entries,  and  place them in your calendar file.
  1036.        To use this feature, you should set the calendar  filename
  1037.        option  under  EEllmm to be something like "~/.reminders.in",
  1038.        _n_o_t your main reminder file!  This is so that any  RRUUNN  OONN
  1039.        commands mailed to you can never be activated.
  1040.  
  1041.        Then,  you  can  use  the  EEllmm  _s_c_a_n  _m_e_s_s_a_g_e _f_o_r _c_a_l_e_n_d_a_r
  1042.        _e_n_t_r_i_e_s command to place reminders prefaced by  "->"  into
  1043.        .reminders.in.   In your main .reminders file, include the
  1044.        following lines:
  1045.  
  1046.             RUN OFF   # Disable RUN
  1047.             INCLUDE .reminders.in
  1048.             RUN ON    # Re-enable RUN
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                          11 November 1992                      16
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. REMIND(1)                                               REMIND(1)
  1061.  
  1062.  
  1063. TTHHEE BBAANNNNEERR CCOOMMMMAANNDD
  1064.        When RReemmiinndd first issues a reminder, it prints  a  message
  1065.        like this:
  1066.  
  1067.             Reminders for Friday, 30th October, 1992 (today):
  1068.  
  1069.        The  BBAANNNNEERR command lets you change the format.  It should
  1070.        appear before any RREEMM commands.  The format is:
  1071.  
  1072.               BBAANNNNEERR _f_o_r_m_a_t
  1073.  
  1074.        The _f_o_r_m_a_t is similar to the _b_o_d_y of a RREEMM command.  It is
  1075.        passed  through  the substitution filter, with an implicit
  1076.        trigger of the current system  date.   Thus,  the  default
  1077.        banner is equivalent to:
  1078.  
  1079.             BANNER Reminders for %w, %d%s %m, %y%o:
  1080.  
  1081.        You  can  disable the banner completely with BANNER %.  Or
  1082.        you can create a custom banner:
  1083.  
  1084.             BANNER Hi - here are your reminders for %y/%t/%r:
  1085.  
  1086. CCOONNTTRROOLLLLIINNGG TTHHEE OOMMIITT CCOONNTTEEXXTT
  1087.        Sometimes, it  is  necessary  to  temporarily  change  the
  1088.        global  OOMMIITTss  which  are  in  force  for a few reminders.
  1089.        Three commands allow you to do this:
  1090.  
  1091.        PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT
  1092.               This command saves the current global OOMMIITTss  on  an
  1093.               internal stack.
  1094.  
  1095.        CCLLEEAARR--OOMMIITT--CCOONNTTEEXXTT
  1096.               This command clears all of the global OOMMIITTss, start-
  1097.               ing you off with a "clean slate."
  1098.  
  1099.        PPOOPP--OOMMIITT--CCOONNTTEEXXTT
  1100.               This command restores the global OOMMIITTss  which  were
  1101.               saved by the most recent PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT.
  1102.  
  1103.        For  example,  suppose you have a block of reminders which
  1104.        require a clear OOMMIITT context, and that they also introduce
  1105.        unwanted  global  OOMMIITTss  which  could interfere with later
  1106.        reminders.  You could use the following fragment:
  1107.  
  1108.             PUSH-OMIT-CONTEXT   # Save the current context
  1109.             CLEAR-OMIT-CONTEXT  # Clean the slate
  1110.             # Block of reminders goes here
  1111.             POP-OMIT-CONTEXT    # Restore the saved omit context
  1112.  
  1113. EEXXPPRREESSSSIIOONNSS
  1114.        In certain contexts, to be described  later,  RReemmiinndd  will
  1115.        accept  expressions  for  evaluation.   RReemmiinndd expressions
  1116.        resemble C expressions, but operate on different types  of
  1117.  
  1118.  
  1119.  
  1120.                          11 November 1992                      17
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. REMIND(1)                                               REMIND(1)
  1127.  
  1128.  
  1129.        objects.
  1130.  
  1131.        DDAATTAA TTYYPPEESS
  1132.  
  1133.        RReemmiinndd expressions understand four types of objects:
  1134.  
  1135.        IINNTT    The  IINNTT  data type consists of the integers repre-
  1136.               sentable in one machine word.  The  IINNTT  data  type
  1137.               corresponds to the C "int" type.
  1138.  
  1139.        SSTTRRIINNGG The SSTTRRIINNGG data type consists of strings of charac-
  1140.               ters.  It is somewhat comparable to a  C  character
  1141.               array,  but  more closely resembles the string type
  1142.               in BASIC.
  1143.  
  1144.        TTIIMMEE   The TTIIMMEE data type consists of times  of  the  day.
  1145.               The TTIIMMEE data type is internally stored as an inte-
  1146.               ger representing the number of minutes  since  mid-
  1147.               night.
  1148.  
  1149.        DDAATTEE   The  DDAATTEE data type consists of dates (later than 1
  1150.               January 1990.)  Internally, DDAATTEE objects are stored
  1151.               as the number of days since 1 January 1990.
  1152.  
  1153.        CCOONNSSTTAANNTTSS
  1154.  
  1155.        The  following  examples  illustrate  constants  in RReemmiinndd
  1156.        expressions:
  1157.  
  1158.        IINNTT ccoonnssttaannttss
  1159.               12, 36, -10, 0, 1209
  1160.  
  1161.        SSTTRRIINNGG ccoonnssttaannttss
  1162.               "Hello there", "This is a test", "\n\gosd\w", ""
  1163.  
  1164.               Note that the empty string is  represented  by  "",
  1165.               and  that  backslashes  in  a string are _n_o_t inter-
  1166.               preted specially, as in they are in C.
  1167.  
  1168.        TTIIMMEE ccoonnssttaannttss
  1169.               12:33, 0:01, 14:15, 16:42
  1170.  
  1171.               Note that TTIIMMEE constants  are  written  in  24-hour
  1172.               format
  1173.  
  1174.        DDAATTEE ccoonnssttaannttss
  1175.               DDAATTEE  constants  are expressed as 'yyyy/mm/dd', and
  1176.               the single quotes _m_u_s_t be supplied.   This  distin-
  1177.               guishes  date  constants from division of integers.
  1178.               Examples:
  1179.  
  1180.  
  1181.               Note that DDAATTEE constants are _p_r_i_n_t_e_d as  _y_y_y_y/_m_m/_d_d
  1182.               without  the  quotes.   Note  also that versions of
  1183.  
  1184.  
  1185.  
  1186.                          11 November 1992                      18
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. REMIND(1)                                               REMIND(1)
  1193.  
  1194.  
  1195.               RReemmiinndd prior to 03.00.01 did not support date  con-
  1196.               stants.   In  those versions, you must create dates
  1197.               using the ddaattee(()) function.
  1198.  
  1199.        OOPPEERRAATTOORRSS
  1200.  
  1201.        _R_e_m_i_n_d has the following operators.  Operators on the same
  1202.        line have equal precedence, while operators on lower lines
  1203.        have lower precedence than those  on  higher  lines.   The
  1204.        operators approximately correspond to C operators.
  1205.  
  1206.             !  -     (unary logical negation and arithmetic negation)
  1207.             *  /  %
  1208.             +  -
  1209.             <  <=  >  >=
  1210.             ==  !=
  1211.             &&
  1212.             ||
  1213.  
  1214.        DDEESSCCRRIIPPTTIIOONN OOFF OOPPEERRAATTOORRSS
  1215.  
  1216.  
  1217.        !!      Logical  negation.   Can be applied to an IINNTT type.
  1218.               If the operand is non-zero, returns  zero.   Other-
  1219.               wise, returns 1.
  1220.  
  1221.        --      Unary  minus.   Can  be applied to an IINNTT.  Returns
  1222.               the negative of the operand.
  1223.  
  1224.        **      Multiplication.  Returns the product of two IINNTTs.
  1225.  
  1226.        //      Integer division.   Returns  the  quotient  of  two
  1227.               IINNTTs, discarding the remainder.
  1228.  
  1229.        %%      Modulus.   Returns  the remainder upon dividing one
  1230.               IINNTT by another.
  1231.  
  1232.        ++      Has several uses.  These are:
  1233.  
  1234.               IINNTT + IINNTT - returns the sum of two IINNTTs.
  1235.  
  1236.               IINNTT + TTIIMMEE or TTIIMMEE + IINNTT - returns a TTIIMMEE  obtained
  1237.               by adding IINNTT minutes to the original TTIIMMEE.
  1238.  
  1239.               IINNTT  + DDAATTEE or DDAATTEE + IINNTT - returns a DDAATTEE obtained
  1240.               by adding IINNTT days to the original DDAATTEE.
  1241.  
  1242.               SSTTRRIINNGG + SSTTRRIINNGG - returns a  SSTTRRIINNGG  which  is  the
  1243.               concatenation of the two orignal SSTTRRIINNGGs.
  1244.  
  1245.               SSTTRRIINNGG  +  anything or anything + SSTTRRIINNGG - converts
  1246.               the non-SSTTRRIINNGG argument to a SSTTRRIINNGG, and then  per-
  1247.               forms concatenation.  See the ccooeerrccee(()) function.
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                          11 November 1992                      19
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. REMIND(1)                                               REMIND(1)
  1259.  
  1260.  
  1261.        --      Has several uses.  These are:
  1262.  
  1263.               IINNTT - IINNTT - returns the difference of two IINNTTs.
  1264.  
  1265.               DDAATTEE - DDAATTEE - returns (as an IINNTT) the difference in
  1266.               days between two DDAATTEEs.
  1267.  
  1268.               TTIIMMEE - TTIIMMEE - returns (as an IINNTT) the difference in
  1269.               minutes between two TTIIMMEEs.
  1270.  
  1271.               DDAATTEE  - IINNTT - returns a DDAATTEE which is IINNTT days ear-
  1272.               lier than the original DDAATTEE.
  1273.  
  1274.               TTIIMMEE - IINNTT - returns a TTIIMMEE which  is  IINNTT  minutes
  1275.               earlier than the original TTIIMMEE.
  1276.  
  1277.        <<,, <<==,, >>,, aanndd >>==
  1278.               These  are the comparison operators.  They can take
  1279.               operands of any type, but both operands must be  of
  1280.               the  same  type.  The comparison operators return 1
  1281.               if the comparison is true, or 0  if  it  is  false.
  1282.               Note  that  string comparison is done following the
  1283.               lexical ordering of characters on your system,  and
  1284.               that  upper  and  lower case _a_r_e distinct for these
  1285.               operators.
  1286.  
  1287.        ====,, !!== == tests for equality, returning 1 if its  operands
  1288.               are  equal,  and  0  if they are not.  != tests for
  1289.               inequality.
  1290.  
  1291.               If the operands  are  not  of  the  same  type,  ==
  1292.               returns  0 and != returns 1.  Again, string compar-
  1293.               isons are case-sensitive.
  1294.  
  1295.        &&&&     This is the logical  AND  operator.   Both  of  its
  1296.               operands must be of type IINNTT.  It returns 1 if both
  1297.               operands are non-zero, and 0 otherwise.
  1298.  
  1299.        ||||     This is the  logical  OR  operator.   Both  of  its
  1300.               operands  must  be  of  type  IINNTT.  It returns 1 if
  1301.               either operand is non-zero, and 0 otherwise.
  1302.  
  1303.        NNOOTTEESS
  1304.  
  1305.        Operators of equal precedence are  _a_l_w_a_y_s  evaluated  from
  1306.        left to right, except where parentheses dictate otherwise.
  1307.        This is important, because the enhanced "+" and "-" opera-
  1308.        tors are not necessarily associative.  For example:
  1309.  
  1310.             1 + 2 + "string" + 3 + 4  yields "3string34"
  1311.             1 + (2 + "string") + (3 + 4)  yields "12string7"
  1312.             12:59 + 1 + "test"  yields "13:00test"
  1313.             12:59 + (1 + "test")  yields "12:591test"
  1314.  
  1315.  
  1316.  
  1317.  
  1318.                          11 November 1992                      20
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. REMIND(1)                                               REMIND(1)
  1325.  
  1326.  
  1327.        The  logical  operators  are  _n_o_t  so-called short-circuit
  1328.        operators, as they are in C.   Both  operands  are  always
  1329.        evaluated.  Thus, an expression such as:
  1330.  
  1331.             (f!=0) && (100/f <= 3)
  1332.  
  1333.        will cause an error if f is zero.
  1334.  
  1335.        VVAARRIIAABBLLEESS
  1336.  
  1337.        RReemmiinndd  allows you to assign values to variables.  The SSEETT
  1338.        command is used as follows:
  1339.  
  1340.        SSEETT _v_a_r _e_x_p_r
  1341.  
  1342.        _V_a_r is the name of a variable.  It must start with a  let-
  1343.        ter or underscore, and consist only of letters, digits and
  1344.        underscores.  Only the first 12 characters of  a  variable
  1345.        name  are significant.  Variable names are _n_o_t case sensi-
  1346.        tive; thus, "Afoo"  and  "afOo"  are  the  same  variable.
  1347.        Examples:
  1348.  
  1349.             SET a 10 + (9*8)
  1350.             SET b "This is a test"
  1351.             SET mydir getenv("HOME")
  1352.             SET time 12:15
  1353.             SET date today()
  1354.  
  1355.        Note that variables themselves have no type.  They take on
  1356.        the type of whatever you store in them.
  1357.  
  1358.        To delete a variable, use the UUNNSSEETT command:
  1359.  
  1360.        UUNNSSEETT _v_a_r [_v_a_r...]
  1361.  
  1362.        For example, to delete all the variables  declared  above,
  1363.        use:
  1364.  
  1365.             UNSET a b mydir time date
  1366.  
  1367.        BBUUIILLTT--IINN FFUUNNCCTTIIOONNSS
  1368.  
  1369.        RReemmiinndd  has  a plethora of built-in functions.  The syntax
  1370.        for a function call is the same as in  C  -  the  function
  1371.        name,  followed  a  comma-separated  list  of arguments in
  1372.        parentheses.  Function names are not case-sensitive.  If a
  1373.        function  takes  no arguments, it must be followed by "()"
  1374.        in the function call.  Otherwise, RReemmiinndd will interpret it
  1375.        as a variable name, and probably not work correctly.
  1376.  
  1377.        In  the descriptions below, short forms are used to denote
  1378.        acceptable types for the arguments.  The  characters  "i",
  1379.        "s",  "d"  and "t" denote IINNTT, SSTTRRIINNGG, DDAATTEE and TTIIMMEE argu-
  1380.        ments, respectively.  If an argument can be one of several
  1381.  
  1382.  
  1383.  
  1384.                          11 November 1992                      21
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. REMIND(1)                                               REMIND(1)
  1391.  
  1392.  
  1393.        types,  the  characters  are  concatenated.   For example,
  1394.        "di_arg" denotes an argument which can be  a  DDAATTEE  or  an
  1395.        IINNTT.   "x_arg"  denotes  an  argument  which can be of any
  1396.        type.  The type of the argument is followed by  an  under-
  1397.        score  and  an  identifier naming the argument, for conve-
  1398.        nience.
  1399.  
  1400.        The built-in functions are:
  1401.  
  1402.        aabbss((ii__nnuumm))
  1403.               Returns the absolute value of _n_u_m.
  1404.  
  1405.        aacccceessss((ss__ffiillee,, ssii__mmooddee))
  1406.               Tests the access permissions  for  the  file  _f_i_l_e.
  1407.               _M_o_d_e can be a string, containing a mix of the char-
  1408.               acters "rwx" for read, write and execute permission
  1409.               testing.   Alternatively,  _m_o_d_e  can be a number as
  1410.               described in the Unix aacccceessss(2) system  call.   The
  1411.               function returns 0 if the file can be accessed with
  1412.               the specified _m_o_d_e, and -1 otherwise.
  1413.  
  1414.        aasscc((ss__ssttrriinngg))
  1415.               Returns an IINNTT which is the ASCII code of the first
  1416.               character  in  _s_t_r_i_n_g.   As a special case, aasscc((""""))
  1417.               returns 0.
  1418.  
  1419.        bbaasseeyyrr(())
  1420.               Returns the "base year"  which  was  compiled  into
  1421.               RReemmiinndd  (normally  1990.)   All  dates  are  stored
  1422.               internally as the number of days since 1 January of
  1423.               bbaasseeyyrr(()).
  1424.  
  1425.        cchhaarr((ii__ii11 [[,,ii__ii22......]]))
  1426.               This function can take any number of IINNTT arguments.
  1427.               It returns a SSTTRRIINNGG consisting  of  the  characters
  1428.               specified  by the arguments.  Note that none of the
  1429.               arguments can be 0, unless there is only one  argu-
  1430.               ment.  As a special case, cchhaarr((00)) returns "".
  1431.  
  1432.        Note  that  because  RReemmiinndd  does  not support escaping of
  1433.        characters in strings, the only way to get a  double-quote
  1434.        in  a  string  is  to  use cchhaarr((3344)).  Yes, I know it's not
  1435.        portable - it assumes ASCII coding.
  1436.  
  1437.        cchhoooossee((ii__iinnddeexx,, xx__aarrgg11 [[,,xx__aarrgg22......]]))
  1438.               CChhoooossee must take at least two arguments, the  first
  1439.               of  which  is  an IINNTT.  If _i_n_d_e_x is _n, then the _nth
  1440.               subsequent argument is returned.  If _i_n_d_e_x is  less
  1441.               than 1, then _a_r_g_1 is returned.  If _i_n_d_e_x is greater
  1442.               than the number of subsequent arguments,  then  the
  1443.               last argument is returned.  Examples:
  1444.  
  1445.                  cchhoooossee((00,, ""ffoooo"",, 11::1133,, 11000000)) returns "foo"
  1446.                  cchhoooossee((11,, ""ffoooo"",, 11::1133,, 11000000)) returns "foo"
  1447.  
  1448.  
  1449.  
  1450.                          11 November 1992                      22
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. REMIND(1)                                               REMIND(1)
  1457.  
  1458.  
  1459.                  cchhoooossee((22,, ""ffoooo"",, 11::1133,, 11000000)) returns 1:13
  1460.                  cchhoooossee((33,, ""ffoooo"",, 11::1133,, 11000000)) returns 1000
  1461.                  cchhoooossee((44,, ""ffoooo"",, 11::1133,, 11000000)) returns 1000
  1462.               Note  that  all  arguments  to  cchhoooossee(()) are _a_l_w_a_y_s
  1463.               evaluated.
  1464.  
  1465.        ccooeerrccee((ss__ttyyppee,, xx__aarrgg))
  1466.               This function converts _a_r_g to the  specified  _t_y_p_e,
  1467.               if  such  conversion is possible.  _T_y_p_e must be one
  1468.               of  "INT",  "STRING",  "DATE"  or   "TIME"   (case-
  1469.               insensitive).  The conversion rules are as follows:
  1470.  
  1471.               If _a_r_g is already of  the  _t_y_p_e  specified,  it  is
  1472.               returned unchanged.
  1473.  
  1474.               If  _t_y_p_e  is  "STRING",  then _a_r_g is converted to a
  1475.               string consisting of its printed representation.
  1476.  
  1477.               If _t_y_p_e is "DATE", then an IINNTT _a_r_g is converted  by
  1478.               interpreting  it as the number of days since 1 Jan-
  1479.               uary  bbaasseeyyrr(()).   A  SSTTRRIINNGG  _a_r_g  is  converted  by
  1480.               attempting to read it as if it were a printed date.
  1481.               A TTIIMMEE _a_r_g cannot be converted to a date.
  1482.  
  1483.               If _t_y_p_e is "TIME", then an IINNTT _a_r_g is converted  by
  1484.               interpreting it as the number of minutes since mid-
  1485.               night.  A SSTTRRIINNGG _a_r_g is converted by attempting  to
  1486.               read  it  as if it were a printed time.  A DDAATTEE _a_r_g
  1487.               cannot be converted to a time.
  1488.  
  1489.               If _t_y_p_e is "INT", then DDAATTEE and TTIIMMEE arguments  are
  1490.               converted using the reverse of procedures described
  1491.               above.  A SSTTRRIINNGG _a_r_g is converted by parsing it  as
  1492.               an integer.
  1493.  
  1494.        ddaattee((ii__yy,, ii__mm,, ii__dd))
  1495.               The  ddaattee(()) function returns a DDAATTEE object with the
  1496.               year, month and day components specified  by  _y,  _m
  1497.               and _d.
  1498.  
  1499.        ddaayy((dd__ddaattee))
  1500.               This  function  takes  a  DDAATTEE  as an argument, and
  1501.               returns an IINNTT which is the day-of-month  component
  1502.               of _d_a_t_e.
  1503.  
  1504.        ddaayyssiimmoonn((ii__mm,, ii__yy))
  1505.               Returns the number of days in month _m (1-12) of the
  1506.               year _y.
  1507.  
  1508.        ddeeffiinneedd((ss__vvaarr))
  1509.               Returns 1 if the variable named by _v_a_r is  defined,
  1510.               or 0 if it is not.
  1511.               Note  that ddeeffiinneedd(()) takes a SSTTRRIINNGG argument; thus,
  1512.               to check if variable X is defined, use:
  1513.  
  1514.  
  1515.  
  1516.                          11 November 1992                      23
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. REMIND(1)                                               REMIND(1)
  1523.  
  1524.  
  1525.                         defined("X")
  1526.  
  1527.               and not:
  1528.  
  1529.                         defined(X)
  1530.  
  1531.               The second example will attempt to evaluate X,  and
  1532.               will  return  an error if it is undefined or not of
  1533.               type SSTTRRIINNGG.
  1534.  
  1535.        ffiilleennaammee(())
  1536.               Returns (as a SSTTRRIINNGG) the name of the current  file
  1537.               being  processed by RReemmiinndd.  Inside included files,
  1538.               returns the name of the included file.
  1539.  
  1540.        ggeetteennvv((ss__eennvvvvaarr))
  1541.               Similar to the ggeetteennvv(2) system  call.   Returns  a
  1542.               string  representing  the  value  of  the specified
  1543.               environment variable.  Returns "" if  the  environ-
  1544.               ment  variable is not defined.  Note that the names
  1545.               of  environment  variables  are   generally   case-
  1546.               sensitive;  thus, getenv("HOME") is not the same as
  1547.               getenv("home").
  1548.  
  1549.        hhoouurr((tt__ttiimmee))
  1550.               Returns the hour component of _t_i_m_e.
  1551.  
  1552.        iiiiff((ssii__tteesstt,, xx__aarrggttrruuee,, xx__aarrggffaallssee))
  1553.               If _t_e_s_t is not zero, and not the  null  string  "",
  1554.               returns   _a_r_g_t_r_u_e.   Otherwise,  returns  _a_r_g_f_a_l_s_e.
  1555.               Note that all arguments are _a_l_w_a_y_s evaluated.
  1556.  
  1557.        iinnddeexx((ss__sseeaarrcchh,, ss__ttaarrggeett [[,,ii__ssttaarrtt))
  1558.               Returns an IINNTT which is the location of  _t_a_r_g_e_t  in
  1559.               the string _s_e_a_r_c_h.  The first character of a string
  1560.               is numbered 1.  If _t_a_r_g_e_t does not exist in _s_e_a_r_c_h,
  1561.               then 0 is returned.
  1562.               The optional parameter _s_t_a_r_t specifies the position
  1563.               in _s_e_a_r_c_h at which to start looking for _t_a_r_g_e_t.
  1564.  
  1565.        iisslleeaapp((iidd__aarrgg))
  1566.               Returns 1 if _a_r_g is a leap year, and  0  otherwise.
  1567.               _A_r_g  can  be  either an IINNTT or a DDAATTEE object.  If a
  1568.               DDAATTEE is supplied, then the year component  is  used
  1569.               in the test.
  1570.  
  1571.        iissoommiitttteedd((dd__ddaattee))
  1572.               Returns  1  if  _d_a_t_e  is omitted, given the current
  1573.               global OOMMIITT context.  Returns 0 otherwise.
  1574.  
  1575.        lloowweerr((ss__ssttrriinngg))
  1576.               Returns a SSTTRRIINNGG with all upper-case characters  in
  1577.               _s_t_r_i_n_g converted to lower-case.
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                          11 November 1992                      24
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. REMIND(1)                                               REMIND(1)
  1589.  
  1590.  
  1591.        mmaaxx((xx__aarrgg11 [[,,xx__aarrgg22......))
  1592.               Can  take  any number of arguments, and returns the
  1593.               maximum.  The arguments can be  of  any  type,  but
  1594.               must all be of the same type.  They are compared as
  1595.               with the > operator.
  1596.  
  1597.        mmiinn((xx__aarrgg11 [[,,xx__aarrgg22......))
  1598.               Can take any number of arguments, and  returns  the
  1599.               minimum.   The  arguments  can  be of any type, but
  1600.               must all be of the same type.  They are compared as
  1601.               with the < operator.
  1602.  
  1603.        mmiinnuuttee((tt__ttiimmee))
  1604.               Returns the minute component of _t_i_m_e.
  1605.  
  1606.        mmoonn((ddii__aarrgg))
  1607.               If  _a_r_g  is  of  DDAATTEE  type, returns a string which
  1608.               names the month component of the date.  If  _a_r_g  is
  1609.               an  IINNTT  from 1 to 12, returns a string which names
  1610.               the month.
  1611.  
  1612.        mmoonnnnuumm((dd__ddaattee))
  1613.               Returns an IINNTT from 1 to 12, representing the month
  1614.               component of _d_a_t_e.
  1615.  
  1616.        nnooww(())  Returns the current system time, as a TTIIMMEE type.
  1617.  
  1618.        oorrdd((ii__nnuumm))
  1619.               Returns  a  string which is the ordinal number _n_u_m.
  1620.               For example, oorrdd((22))  returns  "2nd",  and  oorrdd((221133))
  1621.               returns "213th".
  1622.  
  1623.        oossttyyppee(())
  1624.               Returns  "UNIX"  on UNIX systems, "MSDOS" on MS-DOS
  1625.               systems, and "OS/2" on OS/2 systems.   If  you  run
  1626.               RReemmiinndd  in  an MS-DOS box under OS/2, this function
  1627.               returns "MSDOS".
  1628.  
  1629.        pplluurraall((ii__nnuumm [[,,ss__ssttrr11 [[,,ss__ssttrr22]]]]))
  1630.               Can take from one to three arguments.  If one argu-
  1631.               ment  is supplied, returns "s" if _n_u_m is not 1, and
  1632.               "" if _n_u_m is 1.
  1633.               If two arguments are supplied, returns _s_t_r_1  +  "s"
  1634.               if _n_u_m is not 1.  Otherwise, returns _s_t_r_1.
  1635.  
  1636.               If  three  arguments  are supplied, returns _s_t_r_1 if
  1637.               _n_u_m is 1, and _s_t_r_2 otherwise.
  1638.  
  1639.        rreeaallttooddaayy(())
  1640.               Returns the date as provided by the operating  sys-
  1641.               tem.   This  is  in contrast to RReemmiinndd's concept of
  1642.               "today", which may be changed if it is  running  in
  1643.               calendar  mode,  or  if a date has been supplied on
  1644.               the command line.
  1645.  
  1646.  
  1647.  
  1648.                          11 November 1992                      25
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. REMIND(1)                                               REMIND(1)
  1655.  
  1656.  
  1657.        ssggnn((ii__nnuumm))
  1658.               Returns -1 if _n_u_m is negative, 1 if  _n_u_m  is  posi-
  1659.               tive, and 0 if _n_u_m is zero.
  1660.  
  1661.        sshheellll((ss__ccmmdd))
  1662.               Executes  _c_m_d  as a system command, and returns the
  1663.               first 511 characters of output resulting from  _c_m_d.
  1664.               Any whitespace character in the output is converted
  1665.               to a space.  Note that if RRUUNN  OOFFFF  has  been  exe-
  1666.               cuted, or the --rr command-line option has been used,
  1667.               sshheellll(()) will result in an error, and _c_m_d  will  not
  1668.               be executed.
  1669.  
  1670.        ssttrrlleenn((ss__ssttrr))
  1671.               Returns the length of _s_t_r.
  1672.  
  1673.        ssuubbssttrr((ss__ssttrr,, ii__ssttaarrtt [[,,ii__eenndd]]))
  1674.               Returns  a  SSTTRRIINNGG  consisting of all characters in
  1675.               _s_t_r from _s_t_a_r_t up to and including _e_n_d.  Characters
  1676.               are  numbered from 1.  If _e_n_d is not supplied, then
  1677.               it defaults to the length of _s_t_r.
  1678.  
  1679.        ttiimmee((ii__hhrr,, ii__mmiinn))
  1680.               Creates a TTIIMMEE with the hour and minute  components
  1681.               specified by _h_r and _m_i_n.
  1682.  
  1683.        ttooddaayy(())
  1684.               Returns  RReemmiinndd's  notion  of "today."  This may be
  1685.               the actual system date, or a date supplied  on  the
  1686.               command  line,  or  the  date of the calendar entry
  1687.               currently being computed.
  1688.  
  1689.        ttrriiggddaattee(())
  1690.               Returns the calculated trigger date of the last RREEMM
  1691.               command.   If  used  in  the _b_o_d_y of a RREEMM command,
  1692.               returns that command's trigger date.
  1693.  
  1694.        ttrriiggggeerr((dd__ddaattee))
  1695.               Returns a string suitable for use in a RREEMM command,
  1696.               allowing you to calculate trigger dates in advance.
  1697.               See  the  section  "Expression  pasting"  for  more
  1698.               information.
  1699.  
  1700.        ttrriiggttiimmee(())
  1701.               Returns the time of the last RREEMM command with an AATT
  1702.               clause.
  1703.  
  1704.        ttrriiggvvaalliidd(())
  1705.               Returns 1 if the value returned  by  ttrriiggddaattee(())  is
  1706.               valid  for the most recent RREEMM command, or 0 other-
  1707.               wise.  Sometimes RREEMM commands  cannot  calculate  a
  1708.               trigger  date.  For example, the following RREEMM com-
  1709.               mand can never be triggered:
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                          11 November 1992                      26
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. REMIND(1)                                               REMIND(1)
  1721.  
  1722.  
  1723.                  REM Mon OMIT Mon SKIP MSG Impossible!
  1724.  
  1725.  
  1726.        ttyyppeeooff((xx__aarrgg))
  1727.               Returns "STRING", "INT", "DATE" or "TIME",  depend-
  1728.               ing on the type of _a_r_g.
  1729.  
  1730.        uuppppeerr((ss__ssttrriinngg))
  1731.               Returns  a SSTTRRIINNGG with all lower-case characters in
  1732.               _s_t_r_i_n_g converted to upper-case.
  1733.  
  1734.        vvaalluuee((ss__vvaarrnnaammee [[,,xx__ddeeffaauulltt]]))
  1735.               Returns the value of the specified  variable.   For
  1736.               example,  value("X"+"Y") returns the value of vari-
  1737.               able XY, if it is defined.  If XY is  not  defined,
  1738.               an error results.
  1739.               However,  if  you  supply  a second argument, it is
  1740.               returned  if  the  _v_a_r_n_a_m_e  is  not  defined.   The
  1741.               expression  value("XY",  0)  will return 0 if XY is
  1742.               not defined, and the value of XY if it is  defined.
  1743.  
  1744.        vveerrssiioonn(())
  1745.               Returns  a string specifying the version of RReemmiinndd.
  1746.               For version 03.00.01, returns  "03.00.01".   It  is
  1747.               guaranteed  that  as  new  versions  of  RReemmiinndd are
  1748.               released, the  value  returned  by  vveerrssiioonn(())  will
  1749.               strictly  increase,  according  to  the  rules  for
  1750.               string ordering.
  1751.  
  1752.        wwkkddaayy((ddii__aarrgg))
  1753.               If _a_r_g is a DDAATTEE, returns a string representing the
  1754.               day of the week of the date.  If _a_r_g is an IINNTT from
  1755.               0 to 6, returns the corresponding weekday ("Sunday"
  1756.               to "Saturday").
  1757.  
  1758.        wwkkddaayynnuumm((dd__ddaattee))
  1759.               Returns  a number from 0 to 6 representing the day-
  1760.               of-week of the specified _d_a_t_e.  (0 represents  Sun-
  1761.               day, and 6 represents Saturday.)
  1762.  
  1763.        yyeeaarr((dd__ddaattee))
  1764.               Returns  a IINNTT which is the year component of _d_a_t_e.
  1765.  
  1766. EEXXPPRREESSSSIIOONN PPAASSTTIINNGG
  1767.        An extremely powerful feature of RReemmiinndd is its macro capa-
  1768.        bility, or "expression pasting."
  1769.  
  1770.        In  almost  any situation where RReemmiinndd is not expecting an
  1771.        expression, you can "paste" an expression in.  To do this,
  1772.        surround  the  expression with square brackets.  For exam-
  1773.        ple:
  1774.  
  1775.             REM [trigger(mydate)] MSG foo
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                          11 November 1992                      27
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. REMIND(1)                                               REMIND(1)
  1787.  
  1788.  
  1789.        This evaluates  the  expression  "trigger(mydate)",  where
  1790.        "mydate"  is  presumably  some  pre-computed variable, and
  1791.        then "pastes" the result into  the  command-line  for  the
  1792.        parser to process.
  1793.  
  1794.        A formal description of this is:  When RReemmiinndd encounters a
  1795.        "pasted-in" expression, it evaluates the  expression,  and
  1796.        coerces  the  result to a SSTTRRIINNGG.  It then substitutes the
  1797.        string for the pasted-in expression, and  continues  pars-
  1798.        ing.   Note,  however, that expressions are evaluated only
  1799.        once, not recursively.  Thus, writing:
  1800.  
  1801.             ["[a+b]"]
  1802.  
  1803.        causes RReemmiinndd to read the  token  "[a+b]".   It  does  not
  1804.        interpret  this  as  a pasted-in expression.  In fact, the
  1805.        only way to get a literal left-bracket into a reminder  is
  1806.        to use ["["].
  1807.  
  1808.        You  can use expression pasting almost anywhere.  However,
  1809.        there are a few exceptions:
  1810.  
  1811.        o      If RReemmiinndd is expecting an expression, as in the SSEETT
  1812.               command,  or  the  IIFF  command,  then no expression
  1813.               pasting takes  place.   The  expression  is  simply
  1814.               evaluated as if the square brackets were not there.
  1815.  
  1816.        o      You cannot use expression  pasting  for  the  first
  1817.               token  on  a line.  For example, the following will
  1818.               not work:
  1819.  
  1820.                  ["SET"] a 1
  1821.               This restriction is because RReemmiinndd must be able  to
  1822.               unambiguously  determine  the first token of a line
  1823.               for the  flow-control  commands  (to  be  discussed
  1824.               later.)
  1825.  
  1826.               In fact, if RReemmiinndd cannot determine the first token
  1827.               on a line, it assumes that it is a RREEMM command.  If
  1828.               expression-pasting  is used, RReemmiinndd assumes it is a
  1829.               RREEMM command.  Thus, the  following  three  commands
  1830.               are equivalent:
  1831.  
  1832.                         REM 12 Nov 1993 AT 13:05 MSG BOO!
  1833.                         12 Nov 1993 AT 13:05 MSG BOO!
  1834.                         [12] ["Nov " + 1993] AT [12:05+60] MSG BOO!
  1835.  
  1836.        o      You  cannot use expression-pasting to determine the
  1837.               type (MMSSGG, CCAALL, etc.) of a RREEMM  command.   You  can
  1838.               paste  expressions  before  and  after the MMSSGG, etc
  1839.               keywords, but cannot do something like this:
  1840.  
  1841.                  REM ["12 Nov 1993 AT 13:05 " + "MSG" + " BOO!"]
  1842.  
  1843.  
  1844.  
  1845.  
  1846.                          11 November 1992                      28
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. REMIND(1)                                               REMIND(1)
  1853.  
  1854.  
  1855.        CCOOMMMMOONN PPIITTFFAALLLLSS IINN EEXXPPRREESSSSIIOONN PPAASSTTIINNGG
  1856.  
  1857.        Remember, when pasting in expressions, that  extra  spaces
  1858.        are not inserted.  Thus, something like:
  1859.  
  1860.             REM[expr]MSG[expr]
  1861.  
  1862.        will probably fail.
  1863.  
  1864.        If  you  use  an  expression to calculate a _d_e_l_t_a or _b_a_c_k,
  1865.        ensure that the result is a  positive  number.   Something
  1866.        like:
  1867.  
  1868.             REM +[mydelta] Nov 12 1993 MSG foo
  1869.  
  1870.        will fail if _m_y_d_e_l_t_a happens to be negative.
  1871.  
  1872.  
  1873. FFLLOOWW CCOONNTTRROOLL CCOOMMMMAANNDDSS
  1874.        RReemmiinndd  has  commands which control the flow of a reminder
  1875.        script.  Normally, reminder scripts are processed  sequen-
  1876.        tially.   However,  IIFF  and  related commands allow you to
  1877.        process files conditionally, and skip sections  which  you
  1878.        don't want interpreted.
  1879.  
  1880.        TTHHEE IIFF CCOOMMMMAANNDD
  1881.  
  1882.        The IIFF command has the following form:
  1883.  
  1884.             IF expr
  1885.                  t-command
  1886.                  t-command...
  1887.             ELSE
  1888.                  f-command
  1889.                  f-command...
  1890.             ENDIF
  1891.  
  1892.        Note  that  the  commands  are shown indented for clarity.
  1893.        Also, the EELLSSEE portion can be omitted.  IIFF commands can be
  1894.        nested up to a small limit, probably around 8 or 16 levels
  1895.        of nesting, depending on your system.
  1896.  
  1897.        If the _e_x_p_r evaluates to a non-zero  IINNTT,  or  a  non-null
  1898.        SSTTRRIINNGG, then the IIFF portion is considered true, and the _t_-
  1899.        _c_o_m_m_a_n_d_s are executed.  If _e_x_p_r evaluates to zero or null,
  1900.        then  the  _f_-_c_o_m_m_a_n_d_s (if the EELLSSEE portion is present) are
  1901.        executed.  If _e_x_p_r is not of type IINNTT or SSTTRRIINNGG,  then  it
  1902.        is an error.
  1903.  
  1904.        Examples:
  1905.  
  1906.             IF defined("want_hols")
  1907.                  INCLUDE /usr/share/remind/holidays
  1908.             ENDIF
  1909.  
  1910.  
  1911.  
  1912.                          11 November 1992                      29
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. REMIND(1)                                               REMIND(1)
  1919.  
  1920.  
  1921.             IF today() > date(1992, 2, 10)
  1922.                  set missed_ap "You missed it!"
  1923.             ELSE
  1924.                  set missed_ap "Still have time..."
  1925.             ENDIF
  1926.  
  1927.        TTHHEE IIFFTTRRIIGG CCOOMMMMAANNDD
  1928.  
  1929.        The  IIFFTTRRIIGG  command  is  similar to an IIFF command, except
  1930.        that it computes a trigger (as in the  RREEMM  command),  and
  1931.        evaluates  to  true  if  a corresponding RREEMM command would
  1932.        trigger.  Examples:
  1933.  
  1934.             IFTRIG 1 Nov
  1935.                  ; Executed on 1 Nov
  1936.             ELSE
  1937.                  ; Executed except on 1 Nov
  1938.             ENDIF
  1939.  
  1940.             IFTRIG 1 -1 OMIT Sat Sun +4
  1941.                  ; Executed on last working day of month,
  1942.                  ; and the 4 working days preceding it
  1943.             ELSE
  1944.                  ; Executed except on above days
  1945.             ENDIF
  1946.  
  1947.        Note that the IIFFTTRRIIGG  command  computes  a  trigger  date,
  1948.        which  can be retrieved with the ttrriiggddaattee(()) function.  You
  1949.        can use all of the  normal  trigger  components,  such  as
  1950.        UUNNTTIILL, _d_e_l_t_a, etc in the IIFFTTRRIIGG command.
  1951.  
  1952.  
  1953. UUSSEERR--DDEEFFIINNEEDD FFUUNNCCTTIIOONNSS
  1954.        In  addition  to the built-in functions, RReemmiinndd allows you
  1955.        to define your own functions.  The FFSSEETT command does  this
  1956.        for you:
  1957.  
  1958.        FFSSEETT _f_n_a_m_e(_a_r_g_s) _e_x_p_r
  1959.  
  1960.        _F_n_a_m_e is the name of the function, and follows the conven-
  1961.        tion for naming variables.  _A_r_g_s is a comma-separated list
  1962.        of  arguments,  and  _e_x_p_r  is  an expression.  _A_r_g_s can be
  1963.        empty, in which case  you  define  a  function  taking  no
  1964.        parameters.  Here are some examples:
  1965.  
  1966.             FSET double(x) 2*x
  1967.             FSET yeardiff(date1, date2) year(date1) - year(date2)
  1968.             FSET since(x) ord(year(trigdate())-x)
  1969.  
  1970.        The  last  function  is useful in birthday reminders.  For
  1971.        example:
  1972.  
  1973.             REM 1 Nov +12 MSG Dean's [since(1984)] birthday is %b.
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                          11 November 1992                      30
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. REMIND(1)                                               REMIND(1)
  1985.  
  1986.  
  1987.        Dean was born in 1984.  The above example, on  1  November
  1988.        1992, would print:
  1989.  
  1990.             Dean's 8th birthday is today.
  1991.  
  1992.        Notes:
  1993.  
  1994.        o      If  you  access  a variable in _e_x_p_r which is not in
  1995.               the list of arguments, the "global" value (if  any)
  1996.               is used.
  1997.  
  1998.        o      Function  and  parameter names are significant only
  1999.               to 12 characters.
  2000.  
  2001.        o      The vvaalluuee(()) function _a_l_w_a_y_s accesses  the  "global"
  2002.               value  of  a variable, even if it has the same name
  2003.               as an argument.  For example:
  2004.                         fset func(x) value("x")
  2005.                         set x 1
  2006.                         set y func(5)
  2007.  
  2008.               The above sequence sets y to 1, which is the global
  2009.               value of x.
  2010.  
  2011.        o      User-defined  functions  may  call other functions,
  2012.               including other user-defined  functions.   However,
  2013.               recursive calls are not allowed.
  2014.  
  2015.        o      User-defined  functions are not syntax-checked when
  2016.               they are defined; parsing occurs only when they are
  2017.               called.
  2018.  
  2019.        o      If  a  user-defined function has the same name as a
  2020.               built-in function, it is ignored and  the  built-in
  2021.               function is used.  To prevent conflicts with future
  2022.               versions of RReemmiinndd (which may define more  built-in
  2023.               functions),  you  may wish to name all user-defined
  2024.               functions beginning with an underscore.
  2025.  
  2026.  
  2027. TTHHEE SSAATTIISSFFYY CCLLAAUUSSEE
  2028.        The form of RREEMM which uses SSAATTIISSFFYY is as follows:
  2029.  
  2030.        RREEMM _t_r_i_g_g_e_r SSAATTIISSFFYY _e_x_p_r
  2031.  
  2032.        The way this works is as follows:  RReemmiinndd first calculates
  2033.        a  trigger  date,  in  the  normal fashion.  Next, it sets
  2034.        ttrriiggddaattee(()) to the calculated trigger date.  It then evalu-
  2035.        ates  _e_x_p_r.  If the result is not the null string or zero,
  2036.        processing ends.   Otherwise,  RReemmiinndd  computes  the  next
  2037.        trigger date, and re-tests _e_x_p_r.  This iteration continues
  2038.        until _e_x_p_r evaluates to non-zero or non-null, or until the
  2039.        iteration  limit specified with the --xx command-line option
  2040.        is reached.
  2041.  
  2042.  
  2043.  
  2044.                          11 November 1992                      31
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. REMIND(1)                                               REMIND(1)
  2051.  
  2052.  
  2053.        If _e_x_p_r is not satisfied, then ttrriiggvvaalliidd(()) is  set  to  0.
  2054.        Otherwise,  ttrriiggvvaalliidd(())  is  set  to  1.  In any event, no
  2055.        error message is issued.
  2056.  
  2057.        This is really useful only if _e_x_p_r involves a call to  the
  2058.        ttrriiggddaattee(())  function;  otherwise,  _e_x_p_r will not change as
  2059.        RReemmiinndd iterates.
  2060.  
  2061.        An example of the usefulness of SSAATTIISSFFYY:  Suppose you wish
  2062.        to be warned of every Friday the 13th.  Your first attempt
  2063.        may be:
  2064.  
  2065.             # WRONG!
  2066.             REM Fri 13 +2 MSG Friday the 13th is %b.
  2067.  
  2068.        But this won't work.  This reminder triggers on the  first
  2069.        Friday  on or after the 13th of each month.  The way to do
  2070.        it is with a more complicated sequence:
  2071.  
  2072.             REM 13 SATISFY wkdaynum(trigdate()) == 5
  2073.             IF trigvalid()
  2074.                  REM [trigger(trigdate())] +2 MSG \
  2075.                  Friday the 13th is %b.
  2076.             ENDIF
  2077.  
  2078.        Let's see how this works.   The  SSAATTIISSFFYY  clause  iterates
  2079.        through  all the 13ths of successive months, until a trig-
  2080.        ger date is found whose day-of-week is Friday (== 5).   If
  2081.        a valid date was found, we use the calculated trigger date
  2082.        (converted into a trigger format with the ttrriiggggeerr(())  func-
  2083.        tion) to set up the next reminder.
  2084.  
  2085.        We could also have written:
  2086.  
  2087.             REM Fri SATISFY day(trigdate()) == 13
  2088.  
  2089.        but  this would result in more iterations, since "Fridays"
  2090.        occur more often than "13ths of the month."
  2091.  
  2092.        This technique of using one RREEMM  command  to  calculate  a
  2093.        trigger date to be used by another command is quite power-
  2094.        ful.  For example, suppose you wanted to OMIT Labour  day,
  2095.        which is the first Monday in September.  You could use:
  2096.  
  2097.             # Note: SATISFY 1 is an idiom for "do nothing"
  2098.             REM Mon 1 Sept SATISFY 1
  2099.             OMIT [trigger(trigdate())]
  2100.  
  2101.        CCAAVVEEAATT::  This  _o_n_l_y  omits  the  _n_e_x_t  Labour Day, not all
  2102.        Labour Days in  the  future.   This  could  cause  strange
  2103.        results,  as  the OOMMIITT context can change depending on the
  2104.        current date.  For example, if you use the following  com-
  2105.        mand after the above commands:
  2106.  
  2107.  
  2108.  
  2109.  
  2110.                          11 November 1992                      32
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. REMIND(1)                                               REMIND(1)
  2117.  
  2118.  
  2119.             REM Mon AFTER msg hello
  2120.  
  2121.        the  result will not be as you expect.  Consider producing
  2122.        a calendar for September, 1992.  Labour Day was on Monday,
  2123.        7  September,  1992.   However, when RReemmiinndd gets around to
  2124.        calculating the trigger for Tuesday,  8  September,  1992,
  2125.        the  OOMMIITT  command  will  now  be ommitting Labour Day for
  2126.        1993, and the "Mon AFTER" command will not be triggered.
  2127.  
  2128.        It is probably best to stay away from computing OOMMIITT trig-
  2129.        ger dates unless you keep these pitfalls in mind.
  2130.  
  2131.  
  2132. DDEEBBUUGGGGIINNGG RREEMMIINNDDEERR SSCCRRIIPPTTSS
  2133.        Although  the  command-line --dd option is useful for debug-
  2134.        ging, it is often overkill.  For example, if you  turn  on
  2135.        the  --ddxx  option  for  a  reminder  file with many complex
  2136.        expressions, you'll get a  huge  amount  of  output.   The
  2137.        DDEEBBUUGG  command  allows  you to control the debugging flags
  2138.        under program control.  The format is:
  2139.  
  2140.        DDEEBBUUGG [+_f_l_a_g_s_o_n] [-_f_l_a_g_s_o_f_f]
  2141.  
  2142.        _F_l_a_g_s_o_n and _f_l_a_g_s_o_f_f consist of strings of the  characters
  2143.        "extvl"  which  correspond  to  the debugging options dis-
  2144.        cussed in the command-line options section.   If  preceded
  2145.        with  a  "+", the corresponding group of debugging options
  2146.        is switched on.  Otherwise, they are  switched  off.   For
  2147.        example,  you  could  use this sequence to debug a compli-
  2148.        cated expression:
  2149.  
  2150.             DEBUG +x
  2151.             set a very_complex_expression(many_args)
  2152.             DEBUG -x
  2153.  
  2154.        TTHHEE DDUUMMPPVVAARRSS CCOOMMMMAANNDD
  2155.  
  2156.        The command DDUUMMPPVVAARRSS displays the values of  variables  in
  2157.        memory.  Its format is:
  2158.  
  2159.        DDUUMMPPVVAARRSS [_v_a_r...]
  2160.  
  2161.        If  you  supply  a space-separated list of variable names,
  2162.        the corresponding variables are displayed.  If you do  not
  2163.        supply  a  list of variables, then all variables in memory
  2164.        are displayed.
  2165.  
  2166.        TTHHEE EERRRRMMSSGG CCOOMMMMAANNDD
  2167.  
  2168.        The EERRRRMMSSGG command has the following format:
  2169.  
  2170.        EERRRRMMSSGG _b_o_d_y
  2171.  
  2172.        The _b_o_d_y is passed through the substitution  filter  (with
  2173.  
  2174.  
  2175.  
  2176.                          11 November 1992                      33
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. REMIND(1)                                               REMIND(1)
  2183.  
  2184.  
  2185.        an  implicit  trigger  date of ttooddaayy(())) and printed to the
  2186.        error output stream.  Example:
  2187.  
  2188.             IF !defined("critical_var")
  2189.                  ERRMSG You must supply a value for "critical_var"
  2190.                  EXIT
  2191.             ENDIF
  2192.  
  2193.        TTHHEE EEXXIITT CCOOMMMMAANNDD
  2194.  
  2195.        The above example also shows the use of the EEXXIITT  command.
  2196.        This  causes an unconditional exit from script processing.
  2197.        Any queued timed reminders are discarded.  If you  are  in
  2198.        calendar mode (described next), then the calendar process-
  2199.        ing is aborted.
  2200.  
  2201.  
  2202. CCAALLEENNDDAARR MMOODDEE
  2203.        If you supply the --cc, --ss or --pp command-line  option,  then
  2204.        RReemmiinndd  runs  in  "calendar  mode."   In this mode, RReemmiinndd
  2205.        interprets the script repeatedly, performing one iteration
  2206.        through  the  whole  file  for  each  day in the calendar.
  2207.        Reminders which trigger are saved in internal buffers, and
  2208.        then inserted into the calendar in the appropriate places.
  2209.  
  2210.        The --pp option is used in conjunction with the rreemm22ppss  pro-
  2211.        gram  to  produce  a  calendar  in PostScript format.  For
  2212.        example, the following command will send  PostScript  code
  2213.        to standard output:
  2214.  
  2215.             remind -p .reminders | rem2ps
  2216.  
  2217.        You  can print a PostScript calendar by piping this to the
  2218.        llpprr command.
  2219.  
  2220.        If you have a reminder script called ".reminders", and you
  2221.        execute this command:
  2222.  
  2223.             remind -c .reminders jan 1993
  2224.  
  2225.        then  RReemmiinndd  executes  the script 31 times, once for each
  2226.        day in January.  Each time  it  executes  the  script,  it
  2227.        increments  the  value  of  ttooddaayy(()).   Any reminders whose
  2228.        trigger date matches ttooddaayy(()) are entered into  the  calen-
  2229.        dar.
  2230.  
  2231.        MMSSGG  and CCAALL-type reminders, by default, have their entire
  2232.        body inserted into the calendar.  RRUUNN-type  reminders  are
  2233.        not  normally inserted into the calendar.  However, if you
  2234.        enclose a portion of the body  in  the  %"...%"  sequence,
  2235.        only  that portion is inserted.  For example, consider the
  2236.        following:
  2237.  
  2238.             REM 6 Jan MSG %"David's birthday%" is %b
  2239.  
  2240.  
  2241.  
  2242.                          11 November 1992                      34
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. REMIND(1)                                               REMIND(1)
  2249.  
  2250.  
  2251.        In the normal mode, RReemmiinndd would print  "David's  birthday
  2252.        is  today"  on  6 January.  However, in the calendar mode,
  2253.        only the text "David's birthday" is inserted into the  box
  2254.        for 6 January.
  2255.  
  2256.        If  you  explicitly use the %"...%" sequence in a RRUUNN-type
  2257.        reminder, then the text between the delimiters is inserted
  2258.        into  the calendar.  If you use the sequence %"%" in a MMSSGG
  2259.        or CCAALL-type reminder, then no calendar entry  is  produced
  2260.        for that reminder.
  2261.  
  2262.        PPRREESSEERRVVIINNGG VVAARRIIAABBLLEESS
  2263.  
  2264.        Because RReemmiinndd iterates through the script for each day in
  2265.        the calendar, slow  operations  may  severely  reduce  the
  2266.        speed of producing a calendar.
  2267.  
  2268.        For example, suppose you set the variables "me" and "host-
  2269.        name" as follows:
  2270.  
  2271.             SET me shell("whoami")
  2272.             SET hostname shell("hostname")
  2273.  
  2274.        Normally, RReemmiinndd clears all variables  between  iterations
  2275.        in  calendar mode.  However, if certain variables are slow
  2276.        to compute, and will not change  between  iterations,  you
  2277.        can  "preserve"  their  values  with the PPRREESSEERRVVEE command.
  2278.        Also, since function  definitions  are  preserved  between
  2279.        calendar  iterations, there is no need to redefine them on
  2280.        each  iteration.   Thus,  you  could  use  the   following
  2281.        sequence:
  2282.  
  2283.             IF ! defined("initialized")
  2284.                  set initialized 1
  2285.                  set me shell("whoami")
  2286.                  set hostname shell("hostname")
  2287.                  fset func complex_expr()
  2288.                  preserve initialized me hostname
  2289.             ENDIF
  2290.  
  2291.        The  operation  is  as  follows:   On  the first iteration
  2292.        through the script, "initialized" is not  defined.   Thus,
  2293.        the  commands between IIFF and EENNDDIIFF are executed.  The PPRREE--
  2294.        SSEERRVVEE command ensures that the values of  initialized,  me
  2295.        and  hostname are preserved for subsequent iterations.  On
  2296.        the next iteration, the commands are skipped,  since  ini-
  2297.        tialized has remained defined.  Thus, time-consuming oper-
  2298.        ations which do not depend on the  value  of  ttooddaayy(())  are
  2299.        done only once.
  2300.  
  2301.        Note  that  for  efficiency,  RReemmiinndd  caches  the reminder
  2302.        script (and any IINNCCLLUUDDEEd files) in memory when producing a
  2303.        calendar.
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                          11 November 1992                      35
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. REMIND(1)                                               REMIND(1)
  2315.  
  2316.  
  2317.        Timed reminders are sorted and placed into the calendar in
  2318.        time order.  These are followed  by  non-timed  reminders.
  2319.        RReemmiinndd automatically places the time of timed reminders in
  2320.        the calendar according to the --bb command-line option.
  2321.  
  2322.  
  2323. DDAAEEMMOONN MMOODDEE
  2324.        If you use the --zz command-line option, RReemmiinndd runs in  the
  2325.        "daemon"  mode.   In  this mode, no "normal" reminders are
  2326.        issued.  Instead, only timed reminders are  collected  and
  2327.        queued,  and  are  then  issued  whenever they reach their
  2328.        trigger time.
  2329.  
  2330.        In addition, RReemmiinndd wakes up every few  minutes  to  check
  2331.        the modification date on the reminder script (the filename
  2332.        supplied on the command line.)  If RReemmiinndd detects that the
  2333.        script  has changed, it re-executes itself in daemon mode,
  2334.        and interprets the changed script.
  2335.  
  2336.        In daemon mode, RReemmiinndd also  re-reads  the  remind  script
  2337.        when it detects that the system date has changed.
  2338.  
  2339.        In  daemon  mode, RReemmiinndd acts as if the --ff option had been
  2340.        used, so to run in the daemon mode in the background, use:
  2341.  
  2342.             remind -z .reminders &
  2343.  
  2344.        If  you  use  sshh  or bbaasshh, you may have to use the "nohup"
  2345.        command to ensure that the daemon is not  killed  whn  you
  2346.        log out.
  2347.  
  2348.  
  2349. MMIISSCCEELLLLAANNEEOOUUSS
  2350.        CCOOMMMMAANNDD AABBBBRREEVVIIAATTIIOONNSS
  2351.  
  2352.        The following commands can be abbreviated:
  2353.  
  2354.        o      RREEMM  can  be  omitted  -  it is implied if no other
  2355.               valid command is present.
  2356.  
  2357.        o      CCLLEEAARR--OOMMIITT--CCOONNTTEEXXTT --> CCLLEEAARR
  2358.  
  2359.        o      PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT --> PPUUSSHH
  2360.  
  2361.        o      PPOOPP--OOMMIITT--CCOONNTTEEXXTT --> PPOOPP
  2362.  
  2363.        o      DDUUMMPPVVAARRSS --> DDUUMMPP
  2364.  
  2365.        o      BBAANNNNEERR --> BBAANN
  2366.  
  2367.        o      IINNCCLLUUDDEE --> IINNCC
  2368.  
  2369.        NNIIFFTTYY EEXXAAMMPPLLEESS
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                          11 November 1992                      36
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. REMIND(1)                                               REMIND(1)
  2381.  
  2382.  
  2383.        This section is a sampling of what you can do with RReemmiinndd.
  2384.  
  2385.             REM 5 Feb 1991 AT 14:00 +45 *30 \
  2386.             RUN mail -s "Meeting at %2" $LOGNAME </dev/null &
  2387.  
  2388.        On 5 February, 1991, this reminder will mail you reminders
  2389.        of a 2:00pm meeting at 1:15, 1:45 and 2:00.   The  subject
  2390.        of  the  mail  message will be "Meeting at 2:00pm" and the
  2391.        body of the message will be blank.
  2392.  
  2393.             REM AT 17:00 RUN echo "5:00pm - GO HOME!" | xless -g +0+0 &
  2394.  
  2395.        This reminder will pop up an xless window at 5:00pm  every
  2396.        day.   The xless window will contain the line "5:00pm - GO
  2397.        HOME!"
  2398.  
  2399.             REM AT 23:59 RUN (sleep 120; remind -a [filename()]) &
  2400.  
  2401.        This reminder will run at one minute to midnight.  It will
  2402.        cause  a  new  remind  process to start at one minute past
  2403.        midnight.  This allows you to have a  continuous  reminder
  2404.        service  so  you  can work through the night and still get
  2405.        timed reminders for early in the morning.  Note that  this
  2406.        trick  is no longer necessary, providing you run RReemmiinndd in
  2407.        daemon mode.
  2408.  
  2409.             remind -c12 /dev/null Jan 1993
  2410.  
  2411.        This invocation of rreemmiinndd will cause it to print a  calen-
  2412.        dar for 1993, with all entries left blank.
  2413.  
  2414.             REM CAL [trigdate()-date(year(trigdate()), 1, 1)+1]
  2415.  
  2416.        This example puts an entry in each box of a calendar show-
  2417.        ing the number (1-365 or 366) of the day of the year.
  2418.  
  2419.             REM Tue 2 Nov SATISFY (year(trigdate())%4) == 0
  2420.             IF trigvalid()
  2421.                  REM [trigger(trigdate())] ++5 MSG \
  2422.                  U.S. Presidential Election!!
  2423.             ENDIF
  2424.  
  2425.        This example warns you 5 days ahead of each American pres-
  2426.        idential  election.   The first RREEMM command calculates the
  2427.        first Tuesday after the first Monday in  November.   (This
  2428.        is  equivalent  to  the first Tuesday on or after 2 Novem-
  2429.        ber.)  The SSAATTIISSFFYY clause ensures that the trigger date is
  2430.        issued  only  in election years, which are multiples of 4.
  2431.        The second RREEMM command actually issues the reminder.
  2432.  
  2433.        DDEETTAAIILLSS AABBOOUUTT TTRRIIGGVVAALLIIDD(())
  2434.  
  2435.        The ttrriiggvvaalliidd(()) function returns 1 if RReemmiinndd could find  a
  2436.        trigger date for the previous RREEMM or IIFFTTRRIIGG command.  More
  2437.  
  2438.  
  2439.  
  2440.                          11 November 1992                      37
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. REMIND(1)                                               REMIND(1)
  2447.  
  2448.  
  2449.        specifically, it returns 1 if RReemmiinndd finds a date  _n_o_t  _i_n
  2450.        _t_h_e  _p_a_s_t which satisfies the trigger.  In addition, there
  2451.        is one special case in which  ttrriiggvvaalliidd(())  returns  1  and
  2452.        ttrriiggddaattee(()) returns a meaningful result:
  2453.  
  2454.        If  the  RREEMM  or  IIFFTTRRIIGG  command did not contain an UUNNTTIILL
  2455.        clause, and contained all of the _d_a_y, _m_o_n_t_h and _y_e_a_r  com-
  2456.        ponents,  then  RReemmiinndd  will  correctly  compute a trigger
  2457.        date, even if it happens to be in  the  past.   Note  that
  2458.        this behaviour is not true for versions of RReemmiinndd prior to
  2459.        03.00.01.
  2460.  
  2461. AAUUTTHHOORR
  2462.        David F. Skoll
  2463.  
  2464. BBUUGGSS
  2465.        Date calculation is a bit "brute force."
  2466.  
  2467.        The MS-DOS and 16-bit OS/2 versions of RReemmiinndd do not  sup-
  2468.        port queuing or timed activation of reminders.
  2469.  
  2470.        RReemmiinndd has some built-in limits on total line length, sub-
  2471.        stitution buffer length, number of global OOMMIITTs, etc.
  2472.  
  2473.  
  2474. SSEEEE AALLSSOO
  2475.        rem, elm, kall, rem2ps
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.                          11 November 1992                      38
  2507.  
  2508.  
  2509.